Re: [xml] Compile error libxml2-2.1.1/WIN32

Date view Thread view Subject view Author view

From: Erwin Rol (Erwin.Rol@q-soft-engineering.com)
Date: Thu Jul 06 2000 - 07:55:49 EDT


Hello all,

i just wanted to ask what the state is of LIBXML2 on WIN32.
I saw some typicle UNIX->WIN32 probleems like using int's for
socket descriptors and not the SOCKET type in wIN32 (that is unsigned).
And checking < 0 for errors from network functions which is not the
recomended way on WIN32. Also the below named socklen_t isn't defined
int WIN32. and the getsockopt warning wants a char* and not a int*.
Also htons wants a short and not a int (ports are 16bit so why using
a int in the first place ?) The compiler has problems with the function
pointers in

xmlXPathFunction
xmlXPathIsFunction(xmlXPathParserContextPtr ctxt, const xmlChar *name);

the return statements _seem to need_ a cast to the xmlXPathFunction
type.

The config file could just be config.h and not with a #ifdef WIN32.
just make the config.h file in the distribution the correct file
for WIN32 and put a copy of that config.h in config_win32.h. So when
yer on UNIX you run configure and it will overwrite config.h and
when yer on WIN32 it is correct and won't be over written, this
removes all the ugly #ifdef WIN32 at the start of the file.

There where also some include files not included string.h and strings.h
in some .c files that needed them.

ANd the main question did anybody build a DLL out of it on WIN32. The
normal
way in VC++ seems to put something like this in the files.

in config.h ????

#ifdef LIBXML_EXPORTS
#define LIBXML_API __declspec(dllexport)
#else
#define LIBXML_API __declspec(dllimport)
#endif

and in the files that have functions that need exporting to the outside
world.

LIBXML_API int foo(void);

This could be easely done and on UNIX the defines could just be empty.

So how is the general "standpoint" towards getting libxml working and
compiling
on WIN32 (as a DLL or not) ? And i mean with the MS compiler, and not
gcc. There could
be a simple subdirectory with the project files that can be a realy
seperate .zip file
than the main distribution.

- Erwin

Paul Barnfather wrote:
>
> Compilation fails with:
>
> /usr/local/bin/gcc -DHAVE_CONFIG_H -I. -I. -I. -I. -O2 -msupersparc -c
> nanohttp.c -fPIC -DPIC -o .libs/nanohttp.lo
> nanohttp.c: In function `xmlNanoHTTPConnectAttempt':
> nanohttp.c:659: `socklen_t' undeclared (first use in this function)
> nanohttp.c:659: (Each undeclared identifier is reported only once
> nanohttp.c:659: for each function it appears in.)
> nanohttp.c:659: parse error before `len'
> nanohttp.c:660: `len' undeclared (first use in this function)
> nanohttp.c:661: warning: passing arg 4 of `getsockopt' from incompatible pointer
> type
> make[2]: *** [nanohttp.lo] Error 1
> make[2]: Leaving directory `/src/build/libxml2-2.1.1'
>
> Using gcc-2.95.2/Solaris 2.6.
> Did autoconf miss a library out?
>
> --
> ~~~~~~~~~~~~~~~~~~~~~~~~ Paul Barnfather ~~~~~~~~~~~~~~~~~~~~~~~~~~~
> | plb@clanger9.demon.co.uk paul.barnfather@northern-electric.co.uk |
> | __ http://www.clanger9.demon.co.uk . |
> o--o-... 75TS o'~o... 750SS
> ----
> Message from the list xml@xmlsoft.org
> Archived at : http://xmlsoft.org/messages/
> to unsubscribe: echo "unsubscribe xml" | mail majordomo@xmlsoft.org

-- 
        Q - S O F T - E N G I N E E R I N G 
     Rodachtalweg 11, 81549 Muenchen, Germany

Erwin Rol (Software Engineer) phone: +49-89-68050051 Erwin.Rol@Q-Soft-Engineering.com fax : +49-89-68050052 ---- Message from the list xml@xmlsoft.org Archived at : http://xmlsoft.org/messages/ to unsubscribe: echo "unsubscribe xml" | mail majordomo@xmlsoft.org


Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Wed Aug 02 2000 - 12:30:19 EDT