cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: libcurl 7.17.1 'socklen_t' undefined compile error Visual Studio2005

From: Yang Tse <yangsita_at_gmail.com>
Date: Wed, 21 Nov 2007 20:52:05 +0100

> ------ 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'

Somehow you are including winsock.h besides winsock2.h You can't do
that. It won't work.

Test the following before trying test2 even if test1 fails.

/*---8<-----8<-----8<-----8<-----8<--/
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN 1
#endif
#include <windows.h>
#include <winsock2.h>
#include <ws2tcpip.h>
struct test3 {
  int a_i_3;
  socklen_t a_s_3;
};
/*---8<-----8<-----8<-----8<-----8<--/

-- 
-=[Yang]=-
Received on 2007-11-21