I use Visual Studio 2012 and trying to get static library UDT get to work. Unfortunately, i cannot compile project that links UDT lib to itself, i get 159 strange errors about type or macro redefinitions in windows SDK headers.
c:\program files\windows kits\8.0\include\shared\ws2def.h(96): warning C4005: 'AF_IPX' : macro redefinition
2> c:\program files\windows kits\8.0\include\um\winsock.h(452) : see previous definition of 'AF_IPX'
2>c:\program files\windows kits\8.0\include\shared\ws2def.h(136): warning C4005: 'AF_MAX' : macro redefinition
2> c:\program files\windows kits\8.0\include\um\winsock.h(471) : see previous definition of 'AF_MAX'
2>c:\program files\windows kits\8.0\include\shared\ws2def.h(173): warning C4005: 'SO_DONTLINGER' : macro redefinition
2> c:\program files\windows kits\8.0\include\um\winsock.h(394) : see previous definition of 'SO_DONTLINGER'
2>c:\program files\windows kits\8.0\include\shared\ws2def.h(217): error C2011: 'sockaddr' : 'struct' type redefinition
2> c:\program files\windows kits\8.0\include\um\winsock.h(477) : see declaration of 'sockaddr'
Previously removed some code which was defining dllexport/dllimport for each UDT function:
#define UDT_API // no dllimport/export
I checked that library always use #ifdef to check if file is already included. And this error:
windows kits\8.0\include\um\ws2tcpip.h(703): error C3861: 'WSASetLastError': identifier not found
May reason be const
keyword in that expression (somewhere inside udt):
UDT_API int bind(UDTSOCKET u, const struct sockaddr* name, int namelen);
What iam missing?
If you include winsock.h and winsock2.h make sure that you include winsock2.h first. If the includes are not so obvious you can check cpp files in question if you compile them with /P and walk through the generated preprocessor output file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With