Building problems with libxml

Ask for help regarding any technical issue or report any bug or OS independent issues.
Post Reply
sjoerd222
Peon
Peon
Posts: 6
Joined: 31 Mar 2008, 22:02

Building problems with libxml

Post by sjoerd222 »

Hi

I got probelms building your sourcecode, the libxml/parser.h and other libxml header files are not found. I installed libxml-devel 1.8 and libxml2-devel 2.6.31.
I don't know what's wrong. Any suggestions? what could be wrong?

Are there compilerflags needed?

thx

sjoerd222
Last edited by sjoerd222 on 02 Apr 2008, 21:17, edited 1 time in total.
User avatar
Bjørn
Manasource
Manasource
Posts: 1438
Joined: 09 Dec 2004, 18:50
Location: North Rhine-Westphalia, Germany
Contact:

Re: Building porblems with libxml

Post by Bjørn »

You don't need libxml-devel 1.8, but the libxml2-devel 2.6.31 should be enough I guess. Which operating system are you on? Can you find the header files yourself? Where are they located?

Usually you don't need compiler flags, since configure should figure those out for you.
sjoerd222
Peon
Peon
Posts: 6
Joined: 31 Mar 2008, 22:02

Re: Building porblems with libxml

Post by sjoerd222 »

OS: Fedora 7
path: /usr/include/libxml2/libxml/
User avatar
Jaxad0127
Manasource
Manasource
Posts: 4209
Joined: 01 Nov 2007, 17:35
Location: Internet

Re: Building porblems with libxml

Post by Jaxad0127 »

What command are you using to compile?
Image
sjoerd222
Peon
Peon
Posts: 6
Joined: 31 Mar 2008, 22:02

Re: Building porblems with libxml

Post by sjoerd222 »

g++ `sdl-config --libs` `sdl-config --cflags` -lGL -lGLU -lSDL -lSDL_image -lpthread -g -o prog main.cpp
User avatar
Jaxad0127
Manasource
Manasource
Posts: 4209
Joined: 01 Nov 2007, 17:35
Location: Internet

Re: Building porblems with libxml

Post by Jaxad0127 »

Add this to the options:

Code: Select all

`pkg-config --libs libxml-2.0`
Is there a reason why you're not using the makefile?
Image
sjoerd222
Peon
Peon
Posts: 6
Joined: 31 Mar 2008, 22:02

Re: Building problems with libxml

Post by sjoerd222 »

g++ `sdl-config --libs` `sdl-config --cflags` -lGL -lGLU -lSDL -lSDL_image -lpthread `pkg-config --libs libxml-2.0` -g -o prog main.cpp
main.cpp:36:27: Error: libxml/parser.h: file or folder not found

I use a another symplified makefile for some reasons. I just want to know how to let the compiler find the libxml for now.
User avatar
Jaxad0127
Manasource
Manasource
Posts: 4209
Joined: 01 Nov 2007, 17:35
Location: Internet

Re: Building problems with libxml

Post by Jaxad0127 »

What does "pkg-config --libs libxml-2.0" output in the terminal? It should be something like this:

Code: Select all

-llibxml2/libxml
Image
sjoerd222
Peon
Peon
Posts: 6
Joined: 31 Mar 2008, 22:02

Re: Building problems with libxml

Post by sjoerd222 »

$ pkg-config --libs libxml-2.0
-lxml2
User avatar
Bjørn
Manasource
Manasource
Posts: 1438
Joined: 09 Dec 2004, 18:50
Location: North Rhine-Westphalia, Germany
Contact:

Re: Building problems with libxml

Post by Bjørn »

You also need the flags, like "pkg-config --libs --cflags libxml-2.0":

Code: Select all

tlindeij@horst-dieter:~$ pkg-config --libs --cflags libxml-2.0
-I/usr/include/libxml2  -lxml2
Though usually you would compile and link in separate steps.
sjoerd222
Peon
Peon
Posts: 6
Joined: 31 Mar 2008, 22:02

Re: Building problems with libxml

Post by sjoerd222 »

yeah, thx.
Now the header files are found
Post Reply