cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: libcurl 7.17.1 'socklen_t' undefined compile error Visual Studio 2005

From: Yang Tse <yangsita_at_gmail.com>
Date: Wed, 21 Nov 2007 19:53:55 +0100

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 ?

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<--*/

And if instead of the above you have 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>
#ifndef INET_ADDRSTRLEN
#define socklen_t int
#endif
struct test2 {
  int a_i_2;
  socklen_t a_s_2;
};
/*---8<-----8<-----8<-----8<-----8<--*/

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