GNOME Bugzilla – Bug 55476
nanohttp.c and nanoftp.c fail to compile with MSVC++ 6.0
Last modified: 2009-08-15 18:40:50 UTC
nanohttp.c and nanoftp.c fail to compile with Microsoft Visual C++ 6.0 with many errors related to socket API. The version of libxml2 is 2.3.9 Adding a conditional macro definition for INCLUDE_WINSOCK before including libxml.h as per below fixes these problems. #ifdef WIN32 #define INCLUDE_WINSOCK #endif #include "libxml.h"
It is a bit surprizing, I don't maintain directly the Windows port but I think those issues had been fixed a long time ago using defines in include/winconfig.h and the specific project files in win32/libxml2 Were you using those ? Daniel
dany is right. To compile 2.3.10 (current CVS version is the same), I had to do the following: * add #define INCLUDE_WINSOCK to win32config.h (essentially the same thing what dany did but I think a bit cleaner) * from libxml2.def.src remove reference to sgmlDefaultSAXHandlerInit (looks like a left-over, it's not present anywhere in the code) --- win32/libxml2/libxml2.def.src Fri Apr 27 10:13:01 2001 +++ f:/kjk/src_other/libxml2- 2.3.10/win32/libxml2/libxml2.def.src Wed Jun 06 02:02:16 2001 @@ -434,7 +434,6 @@ cdataBlock xmlDefaultSAXHandlerInit htmlDefaultSAXHandlerInit - sgmlDefaultSAXHandlerInit /* * strio.h --- include/win32config.h Mon Apr 16 10:46:18 2001 +++ f:/kjk/src_other/libxml2-2.3.10/include/win32config.h Wed Jun 06 01:58:12 2001 @@ -9,6 +9,8 @@ #define LIBXML_DLL_IMPORT #define SOCKLEN_T int +#define INCLUDE_WINSOCK + #ifdef INCLUDE_WINSOCK #include <winsock2.h>
Forgot to mention: add catalog.h and catalog.c to MSVC 6.0 project file: --- win32/libxml2/libxml2_so.dsp Mon Apr 16 10:46:18 2001 +++ f:/kjk/src_other/libxml2- 2.3.10/win32/libxml2/libxml2_so.dsp Wed Jun 06 01:55:52 2001 @@ -94,6 +94,10 @@ # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File +SOURCE=..\..\catalog.c +# End Source File +# Begin Source File + SOURCE=..\..\debugXML.c # End Source File # Begin Source File @@ -224,6 +228,10 @@ # PROP Default_Filter "h;hpp;hxx;hm;inl" # Begin Source File +SOURCE=..\..\include\libxml\catalog.h +# End Source File +# Begin Source File + SOURCE=..\..\include\libxml\debugXML.h # End Source File # Begin Source File
Igor Zlatkovic provided a set of patches and updated the projects files, this should fix the problem: http://cvs.gnome.org/bonsai/cvsquery.cgi?module=gnome-xml&branch=HEAD&branchtype=match&dir=gnome-xml&file=&filetype=match&who=veillard&whotype=match&sortby=Date&hours=&date=explicit&mindate=06%2F09%2F01+09%3A52&maxdate=06%2F09%2F01+09%3A52&cvsroot=%2Fcvs%2Fgnome Daniel