|
From: Brendon C. <br...@ch...> - 2006-03-17 07:58:05
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi All, I have some IPv6 socket code i have written to compile using MinGW. The code compiles fine at work but at home it does not. The problem is with certain define directives in the ws2tcpip.h file. I am trying to use the functions below that are not being found: getaddrinfo undeclared (first use this function) freeaddrinfo undeclared (first use this function) getnameinfo undeclared (first use this function) I had a look in the ws2tcpip.h file and noticed that around these functions there is a statement: #if (_WIN32_WINNT >= 0x0501) void WSAAPI freeaddrinfo (struct addrinfo*); int WSAAPI getaddrinfo (const char*,const char*,const struct addrinfo*, struct addrinfo**); int WSAAPI getnameinfo(const struct sockaddr*,socklen_t,char*,DWORD, char*,DWORD,int); #else /* FIXME: Need WS protocol-independent API helpers. */ #endif Looking on the web i found some information saying that you need to define some statements that tell the compiler i want to compile for Windows XP systems or above (So not supporting Win95 etc). I tried defining some/all of the variables in my config.h file: _WIN32_WINNT _WIN32_WINDOWS _WIN32_WINNT WINVER to WindowsXP or 0x0501 and still to no avail. It seems that before the #ifdef statement inside the ws2tcpip.h file, something is re-defining _WIN32_WINNT to a value other than the one i specified. The order of includes is shown below: #include "config.h" #define WIN32_LEAN_AND_MEAN #include <winsock2.h> #include <ws2tcpip.h> #ifndef IPPROTO_IPV6 // If the version of winsock does not by default include IPV6 then // use the tech preview if it is avaliable. #include <tpipv6.h> #endif #include <windows.h> Is there something i need to do differently in order to access getaddrinfo and the other functions? Note: Both the installs (Work and Home) seem to have version 3.3 of the w32api package installed. If you need any other information about installed packages, let me know. Thanks for any help, Brendon. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (MingW32) iD8DBQFEGmv/LSWCuZeiyS0RAnRZAJ9TM3ckX7gxm3jCcfXdW69EeyIxxQCgjJ+n ilb8OBg9XgaJ+PJf1SUy8Yo= =Bmia -----END PGP SIGNATURE----- |