[libmicrohttpd] compile problem on Visual Studio 2010
From:
Jed Irvine
Subject:
[libmicrohttpd] compile problem on Visual Studio 2010
Date:
Fri, 16 Dec 2011 16:49:11 -0800
This is my first time trying to integrate a third party library into a C++ project, so I may be stuck on something basic. For now I'm just trying to get the hellobrowser.c example from the tutorial to build.
I'm using Visual Studio 2010 and trying to hook in libmicrohttpd-0.9.17-w32.
Here's what I did so far: - put the libmicrohttpd-0.9.17-w32 directory in the same directory as the sln -in properties, under C/C++ additional include directories, added :
C:\Documents and Settings\admin-jed\My Documents\Visual Studio 2010\Projects\mhdTest2\libmicrohttpd-0.9.17-w32\include
-in properties, under Linker additional library directories added
C:\Documents and Settings\admin-jed\My Documents\Visual Studio 2010\Projects\mhdTest2\libmicrohttpd-0.9.17-w32\lib (where sits the .dll.a, .a , and .la files
as the new includes. With this arrangement, many basic types are not found, even though I understand they live in BaseTsd.h, for example, ssize_t.
If I add explicit typedefs (which I know I shouldn't do) like this:
typedef unsigned int size_t; //assumes 32 bit typedef int ssize_t; //assumes 32 bit
...then the ssize_t compile problem goes away.
Interestingly, when I guard those statements like this:
#ifndef _SIZE_T_DEFINED typedef unsigned int size_t; //assumes 32 bit typedef int ssize_t; //assumes 32 bit #define _SIZE_T_DEFINED 5
#endif
Then the problems return, suggesting that something is #defining _SIZE_T_DEFINED, yet the related types are not available to the compile. This has me quite confused, though this would not be the first time.