fpagliughi / sockpp

Modern C++ socket library.
BSD 3-Clause "New" or "Revised" License
782 stars 126 forks source link

Some examples won't compile on Windows (VS2015 with update3) #42

Closed tsilia closed 1 year ago

tsilia commented 4 years ago

Hello. I ran into a couple of issues trying to build examples with MSVS2015 update3 on Windows:

  1. Error in the tcpechotest.cpp:
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\random(2387): error C2338: invalid template argument for uniform_int_distribution
F:\dump\sockpp\examples\tcp\tcpechotest.cpp(92): note: see reference to class template instantiation 'std::uniform_int_distribution<char>' being compiled

This is because the template parameter of std::uniform_int_distribution must be either: int, short, long, long long or their unsigned counterpart. Please see Template parameters section here: std::uniform_int_distribution

  1. Error in the udpechosvr.cpp:
F:\dump\sockpp\examples\udp\udpechosvr.cpp(75): error C2666: 'sockpp::datagram_socket_tmpl<sockpp::inet_address>::send_to': 2 overloads have similar conversions
F:\dump\sockpp\include\sockpp/datagram_socket.h(355): note: could be 'ssize_t sockpp::datagram_socket_tmpl<sockpp::inet_address>::send_to(const void *,std::size_t,const ADDR &)'
<...>
F:\dump\sockpp\include\sockpp/datagram_socket.h(345): note: or       'ssize_t sockpp::datagram_socket_tmpl<sockpp::inet_address>::send_to(const std::string &,int,const ADDR &)'

You can see the full error text for the 2nd issue here: https://gist.github.com/tsilia/6c9959ad0393a211970160c598a7cd41

fpagliughi commented 1 year ago

I'm guessing this was fixed a long while ago with #43? If not, feel free to re-open.