RE: [xml] Newbie: libxml2 on cygwin




-----Original Message-----
From: James Shaw [mailto:hertzsprrrung hotmail com] 
Sent: Thursday, April 25, 2002 10:11 PM
To: xml gnome org
Subject: [xml] Newbie: libxml2 on cygwin


I have downloaded + installed cygwin with the libxml2 package.

When I try to include the library, gcc cannot find it - I 
have to manually 
include the directory where libxml is stored.  

That's strange, gcc should automatically search /usr/include. Be sure to
use the correct #include in your source though.

Once built 
into an object 
file, I have problems linking it with libxml, getting the 
following error:

$ gcc -o test htmltest.o
htmltest.o(.text+0x22):htmltest.c: undefined reference to 
`htmlParseFile'
collect2: ld returned 1 exit status

What am I doing wrong?

You need to link against libxml2 - ie
gcc -o test.exe htmltest.o -lxml2

Rob



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]