Page 1 of 1

Building problems with libxml

Posted: 31 Mar 2008, 22:07
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

Re: Building porblems with libxml

Posted: 01 Apr 2008, 07:31
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.

Re: Building porblems with libxml

Posted: 01 Apr 2008, 16:42
by sjoerd222
OS: Fedora 7
path: /usr/include/libxml2/libxml/

Re: Building porblems with libxml

Posted: 01 Apr 2008, 17:37
by Jaxad0127
What command are you using to compile?

Re: Building porblems with libxml

Posted: 01 Apr 2008, 19:36
by sjoerd222
g++ `sdl-config --libs` `sdl-config --cflags` -lGL -lGLU -lSDL -lSDL_image -lpthread -g -o prog main.cpp

Re: Building porblems with libxml

Posted: 01 Apr 2008, 21:00
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?

Re: Building problems with libxml

Posted: 02 Apr 2008, 21:11
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.

Re: Building problems with libxml

Posted: 02 Apr 2008, 23:13
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

Re: Building problems with libxml

Posted: 03 Apr 2008, 09:36
by sjoerd222
$ pkg-config --libs libxml-2.0
-lxml2

Re: Building problems with libxml

Posted: 07 Apr 2008, 18:32
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.

Re: Building problems with libxml

Posted: 07 Apr 2008, 22:20
by sjoerd222
yeah, thx.
Now the header files are found