Closed 014972304505347 closed 6 years ago
It is switched by a macro:
#ifdef WINVER
#include <SDKDDKVer.h>
#include <Ws2tcpip.h>
#else
#include <arpa/inet.h>
#include <sys/fcntl.h>
#include <netdb.h>
#include <sys/ioctl.h>
#include <unistd.h>
#endif
How are you trying to compile it (operating system, platform, compiler, versions etc) ? Try setting the WINVER macro manually if it is not done by your compilation environment already.
Hi Lichtso,
Thanks for your reply. Yeah, I noticed the macro switch after posting this.
Specifics: Windows 10, Visual Studio 2017 version 15.7.2 (updated yesterday) building to x86. Using the Clang/LLVM compiler for x64 machine, LLVM version 6.0.0.
Adding
to a header file fixes this issue.
(taken from here: https://msdn.microsoft.com/en-us/library/6sehtctf.aspx)
You could also try to add the macro as command line option like this:
clang++ ... -DWINVER=0x0A00 ...
Hi Lichtso, I think you should consider changing the switch from
#ifdef WINVER
to
#ifdef _MSC_VER
as according to this Microsoft document, WINVER is not guaranteed to be defined by MSVC. _MSC_VER however, is.
That might explain the problem I had in this thread where my compiler didn't hit the switch even though it was MSVC.
Can you try replacing all 6 occurrences (across the source code) of WINVER by _MSC_VER ?
You should probably state that this library only compiles on Unix systems, as the following block in Core.h:
include <arpa/inet.h>
include <sys/fcntl.h>
include
include <sys/ioctl.h>
include
are not available on Windows. I get errors for each line saying "Cannot open source file ____".