curl-library
RE: libcurl 7.17.1 'socklen_t' undefined compile error Visual Studio2005
Date: Wed, 21 Nov 2007 12:16:21 -0700
Hi, Yang -- thanks for the reply
2007/11/21, Max L. Eidswick wrote:
> I have just upgraded the cURL library yesterday and have begun
> a new project under MS Visual Studio 2005. The libcurl project
> compiles fine. My new project shows an error with only the curl.h
> header loaded. An undefined symbol socklen_t. I have found
> references to this error and VS for older versions, but it seemed
> that this is resolved.
>Are you using a bare bones VS2005 or have you also installed Windows
or Platform SDK ? And which version ?
It is the full VS2005 with the Platform SDK from a couple of months ago.
>If you setup a new project, which doesnt include curl.h and try to
compile a simple source file which has the following lines, what do
you get ?
/*---8<-----8<-----8<-----8<-----8<--*/
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
#include <windows.h>
#include <winsock2.h>
#include <ws2tcpip.h>
struct test1 {
int a_i_1;
socklen_t a_s_1;
};
/*---8<-----8<-----8<-----8<-----8<--*/
Mostly errors from winsock2.h -- I commented out ws2tcpip.h and the struct test and got the first 57 errors. I must be doing
something simple and stupid ...
I did not do the second test yet, since the errors are coming from the winsock2.h header file.
Do you have an idea of what is wrong?
Thanks,
Max
----- snip -----
... lots of errors ...
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock.h(362) : see previous definition of
'IP_DONTFRAGMENT'
Build log was saved at "file://c:\Documents and Settings\max\My Documents\RPS\RPSV7Dvlmt\RedPawComms\Debug\BuildLog.htm"
RedPawComms - 58 error(s), 19 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
---------------- end snip (the whole build error list follows)
------ Build started: Project: RedPawComms, Configuration: Debug Win32 ------
Compiling...
RedPawComms.c
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock2.h(112) : error C2011: 'fd_set' : 'struct' type
redefinition
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock.h(54) : see declaration of 'fd_set'
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock2.h(147) : warning C4005: 'FD_SET' : macro redefinition
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock.h(88) : see previous definition of 'FD_SET'
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock2.h(156) : error C2011: 'timeval' : 'struct' type
redefinition
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock.h(97) : see declaration of 'timeval'
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock2.h(212) : error C2011: 'hostent' : 'struct' type
redefinition
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock.h(153) : see declaration of 'hostent'
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock2.h(225) : error C2011: 'netent' : 'struct' type
redefinition
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock.h(166) : see declaration of 'netent'
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock2.h(232) : error C2011: 'servent' : 'struct' type
redefinition
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock.h(173) : see declaration of 'servent'
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock2.h(244) : error C2011: 'protoent' : 'struct' type
redefinition
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock.h(185) : see declaration of 'protoent'
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock2.h(400) : error C2011: 'sockaddr_in' : 'struct' type
redefinition
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock.h(321) : see declaration of 'sockaddr_in'
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock2.h(410) : error C2011: 'WSAData' : 'struct' type
redefinition
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock.h(331) : see declaration of 'WSAData'
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock2.h(470) : warning C4005: 'SO_DONTLINGER' : macro
redefinition
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock.h(411) : see previous definition of
'SO_DONTLINGER'
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock2.h(527) : warning C4005: 'AF_IPX' : macro redefinition
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock.h(469) : see previous definition of 'AF_IPX'
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock2.h(555) : warning C4005: 'AF_MAX' : macro redefinition
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock.h(488) : see previous definition of 'AF_MAX'
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock2.h(561) : error C2011: 'sockaddr' : 'struct' type
redefinition
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock.h(494) : see declaration of 'sockaddr'
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock2.h(601) : error C2011: 'sockproto' : 'struct' type
redefinition
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock.h(503) : see declaration of 'sockproto'
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock2.h(640) : error C2011: 'linger' : 'struct' type
redefinition
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock.h(540) : see declaration of 'linger'
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock2.h(653) : warning C4005: 'SOMAXCONN' : macro redefinition
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock.h(553) : see previous definition of 'SOMAXCONN'
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock2.h(679) : warning C4005: 'FD_READ' : macro redefinition
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock.h(571) : see previous definition of 'FD_READ'
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock2.h(682) : warning C4005: 'FD_WRITE' : macro redefinition
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock.h(572) : see previous definition of 'FD_WRITE'
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock2.h(685) : warning C4005: 'FD_OOB' : macro redefinition
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock.h(573) : see previous definition of 'FD_OOB'
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock2.h(688) : warning C4005: 'FD_ACCEPT' : macro redefinition
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock.h(574) : see previous definition of 'FD_ACCEPT'
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock2.h(691) : warning C4005: 'FD_CONNECT' : macro redefinition
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock.h(575) : see previous definition of 'FD_CONNECT'
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock2.h(694) : warning C4005: 'FD_CLOSE' : macro redefinition
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock.h(576) : see previous definition of 'FD_CLOSE'
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock2.h(1626) : error C2375: 'accept' : redefinition; different
linkage
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock.h(744) : see declaration of 'accept'
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock2.h(1647) : error C2375: 'bind' : redefinition; different
linkage
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock.h(749) : see declaration of 'bind'
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock2.h(1666) : error C2375: 'closesocket' : redefinition;
different linkage
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock.h(754) : see declaration of 'closesocket'
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock2.h(1685) : error C2375: 'connect' : redefinition;
different linkage
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock.h(756) : see declaration of 'connect'
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock2.h(1706) : error C2375: 'ioctlsocket' : redefinition;
different linkage
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock.h(761) : see declaration of 'ioctlsocket'
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock2.h(1727) : error C2375: 'getpeername' : redefinition;
different linkage
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock.h(766) : see declaration of 'getpeername'
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock2.h(1748) : error C2375: 'getsockname' : redefinition;
different linkage
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock.h(771) : see declaration of 'getsockname'
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock2.h(1771) : error C2375: 'getsockopt' : redefinition;
different linkage
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock.h(776) : see declaration of 'getsockopt'
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock2.h(1792) : error C2375: 'htonl' : redefinition; different
linkage
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock.h(783) : see declaration of 'htonl'
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock2.h(1809) : error C2375: 'htons' : redefinition; different
linkage
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock.h(785) : see declaration of 'htons'
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock2.h(1826) : error C2375: 'inet_addr' : redefinition;
different linkage
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock.h(787) : see declaration of 'inet_addr'
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock2.h(1843) : error C2375: 'inet_ntoa' : redefinition;
different linkage
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock.h(789) : see declaration of 'inet_ntoa'
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock2.h(1861) : error C2375: 'listen' : redefinition; different
linkage
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock.h(791) : see declaration of 'listen'
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock2.h(1879) : error C2375: 'ntohl' : redefinition; different
linkage
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock.h(795) : see declaration of 'ntohl'
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock2.h(1896) : error C2375: 'ntohs' : redefinition; different
linkage
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock.h(797) : see declaration of 'ntohs'
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock2.h(1916) : error C2375: 'recv' : redefinition; different
linkage
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock.h(799) : see declaration of 'recv'
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock2.h(1941) : error C2375: 'recvfrom' : redefinition;
different linkage
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock.h(805) : see declaration of 'recvfrom'
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock2.h(1967) : error C2375: 'select' : redefinition; different
linkage
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock.h(813) : see declaration of 'select'
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock2.h(1991) : error C2375: 'send' : redefinition; different
linkage
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock.h(820) : see declaration of 'send'
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock2.h(2016) : error C2375: 'sendto' : redefinition; different
linkage
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock.h(826) : see declaration of 'sendto'
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock2.h(2042) : error C2375: 'setsockopt' : redefinition;
different linkage
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock.h(834) : see declaration of 'setsockopt'
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock2.h(2064) : error C2375: 'shutdown' : redefinition;
different linkage
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock.h(841) : see declaration of 'shutdown'
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock2.h(2084) : error C2375: 'socket' : redefinition; different
linkage
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock.h(845) : see declaration of 'socket'
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock2.h(2107) : error C2375: 'gethostbyaddr' : redefinition;
different linkage
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock.h(852) : see declaration of 'gethostbyaddr'
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock2.h(2126) : error C2375: 'gethostbyname' : redefinition;
different linkage
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock.h(857) : see declaration of 'gethostbyname'
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock2.h(2144) : error C2375: 'gethostname' : redefinition;
different linkage
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock.h(859) : see declaration of 'gethostname'
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock2.h(2163) : error C2375: 'getservbyport' : redefinition;
different linkage
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock.h(863) : see declaration of 'getservbyport'
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock2.h(2182) : error C2375: 'getservbyname' : redefinition;
different linkage
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock.h(867) : see declaration of 'getservbyname'
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock2.h(2200) : error C2375: 'getprotobynumber' : redefinition;
different linkage
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock.h(871) : see declaration of 'getprotobynumber'
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock2.h(2217) : error C2375: 'getprotobyname' : redefinition;
different linkage
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock.h(873) : see declaration of 'getprotobyname'
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock2.h(2237) : error C2375: 'WSAStartup' : redefinition;
different linkage
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock.h(877) : see declaration of 'WSAStartup'
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock2.h(2255) : error C2375: 'WSACleanup' : redefinition;
different linkage
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock.h(881) : see declaration of 'WSACleanup'
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock2.h(2272) : error C2375: 'WSASetLastError' : redefinition;
different linkage
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock.h(883) : see declaration of 'WSASetLastError'
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock2.h(2289) : error C2375: 'WSAGetLastError' : redefinition;
different linkage
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock.h(885) : see declaration of 'WSAGetLastError'
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock2.h(2306) : error C2375: 'WSAIsBlocking' : redefinition;
different linkage
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock.h(887) : see declaration of 'WSAIsBlocking'
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock2.h(2323) : error C2375: 'WSAUnhookBlockingHook' :
redefinition; different linkage
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock.h(889) : see declaration of
'WSAUnhookBlockingHook'
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock2.h(2340) : error C2375: 'WSASetBlockingHook' :
redefinition; different linkage
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock.h(891) : see declaration of 'WSASetBlockingHook'
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock2.h(2357) : error C2375: 'WSACancelBlockingCall' :
redefinition; different linkage
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock.h(893) : see declaration of
'WSACancelBlockingCall'
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock2.h(2379) : error C2375: 'WSAAsyncGetServByName' :
redefinition; different linkage
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock.h(895) : see declaration of
'WSAAsyncGetServByName'
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock2.h(2406) : error C2375: 'WSAAsyncGetServByPort' :
redefinition; different linkage
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock.h(903) : see declaration of
'WSAAsyncGetServByPort'
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock2.h(2432) : error C2375: 'WSAAsyncGetProtoByName' :
redefinition; different linkage
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock.h(911) : see declaration of
'WSAAsyncGetProtoByName'
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock2.h(2457) : error C2375: 'WSAAsyncGetProtoByNumber' :
redefinition; different linkage
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock.h(918) : see declaration of
'WSAAsyncGetProtoByNumber'
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock2.h(2482) : error C2375: 'WSAAsyncGetHostByName' :
redefinition; different linkage
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock.h(925) : see declaration of
'WSAAsyncGetHostByName'
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock2.h(2509) : error C2375: 'WSAAsyncGetHostByAddr' :
redefinition; different linkage
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock.h(932) : see declaration of
'WSAAsyncGetHostByAddr'
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock2.h(2532) : error C2375: 'WSACancelAsyncRequest' :
redefinition; different linkage
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock.h(941) : see declaration of
'WSACancelAsyncRequest'
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock2.h(2552) : error C2375: 'WSAAsyncSelect' : redefinition;
different linkage
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock.h(943) : see declaration of 'WSAAsyncSelect'
c:\program files\microsoft visual studio 8\vc\platformsdk\include\ws2tcpip.h(28) : error C2011: 'ip_mreq' : 'struct' type
redefinition
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock.h(372) : see declaration of 'ip_mreq'
c:\program files\microsoft visual studio 8\vc\platformsdk\include\ws2tcpip.h(71) : warning C4005: 'IP_TOS' : macro redefinition
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock.h(361) : see previous definition of 'IP_TOS'
c:\program files\microsoft visual studio 8\vc\platformsdk\include\ws2tcpip.h(72) : warning C4005: 'IP_TTL' : macro redefinition
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock.h(360) : see previous definition of 'IP_TTL'
c:\program files\microsoft visual studio 8\vc\platformsdk\include\ws2tcpip.h(73) : warning C4005: 'IP_MULTICAST_IF' : macro
redefinition
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock.h(355) : see previous definition of
'IP_MULTICAST_IF'
c:\program files\microsoft visual studio 8\vc\platformsdk\include\ws2tcpip.h(74) : warning C4005: 'IP_MULTICAST_TTL' : macro
redefinition
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock.h(356) : see previous definition of
'IP_MULTICAST_TTL'
c:\program files\microsoft visual studio 8\vc\platformsdk\include\ws2tcpip.h(75) : warning C4005: 'IP_MULTICAST_LOOP' : macro
redefinition
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock.h(357) : see previous definition of
'IP_MULTICAST_LOOP'
c:\program files\microsoft visual studio 8\vc\platformsdk\include\ws2tcpip.h(76) : warning C4005: 'IP_ADD_MEMBERSHIP' : macro
redefinition
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock.h(358) : see previous definition of
'IP_ADD_MEMBERSHIP'
c:\program files\microsoft visual studio 8\vc\platformsdk\include\ws2tcpip.h(77) : warning C4005: 'IP_DROP_MEMBERSHIP' : macro
redefinition
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock.h(359) : see previous definition of
'IP_DROP_MEMBERSHIP'
c:\program files\microsoft visual studio 8\vc\platformsdk\include\ws2tcpip.h(78) : warning C4005: 'IP_DONTFRAGMENT' : macro
redefinition
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winsock.h(362) : see previous definition of
'IP_DONTFRAGMENT'
Build log was saved at "file://c:\Documents and Settings\max\My Documents\RPS\RPSV7Dvlmt\RedPawComms\Debug\BuildLog.htm"
RedPawComms - 58 error(s), 19 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Received on 2007-11-21