Lichtso / netLink

Socket and Networking Library using msgpack.org[C++11]
GNU General Public License v3.0
217 stars 48 forks source link

Conflict with WINVER on Windows 10 x64 #34

Open DJuego opened 3 years ago

DJuego commented 3 years ago

Hi @Lichtso! It's been a long time! I still use your library! Thanks for this!! I am working in Microsoft Visual Studio 2019 environment. WINVER does not seem to work. I need it for conditional compilation:

#ifdef WINVER
#include <SDKDDKVer.h>
#include <Ws2tcpip.h>
#pragma comment(lib, "Ws2_32.lib")
#undef min
#undef max
#else

I get:

 #error:  WINVER setting conflicts with _WIN32_WINNT setting

DJuego

Lichtso commented 3 years ago

Maybe related: https://github.com/Lichtso/netLink/issues/18#issuecomment-239233412

Can you try replacing #ifdef WINVER by #ifdef _WIN32_WINNT?

DJuego commented 3 years ago

Thank you for your swift answer!

Unfortunately it does not work.

fatal error C1083: Cannot open include file: 'arpa/inet.h': No such file or directory

DJuego

Lichtso commented 3 years ago

I mean you can always force it by replacing #ifdef WINVER by #ifdef true.

But, it would be nice to find a macro like WINVER or _WIN32_WINNT which is automatically set on windows environments. Can you check in your IDE or CMake what macros it defines?