netLink icon indicating copy to clipboard operation
netLink copied to clipboard

Conflict with WINVER on Windows 10 x64

Open DJuego opened this issue 2 years ago • 3 comments

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

DJuego avatar Nov 01 '21 09:11 DJuego

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

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

Lichtso avatar Nov 02 '21 22:11 Lichtso

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

DJuego avatar Nov 02 '21 22:11 DJuego

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?

Lichtso avatar Nov 03 '21 22:11 Lichtso