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, 23:02

Building problems with libxml

Post by sjoerd222 » 31 Mar 2008, 23:07

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, 22:17, edited 1 time in total.
User avatar
Bjørn
TMW Adviser
TMW Adviser
Posts: 1430
Joined: 09 Dec 2004, 19:50
Location: North Rhine-Westphalia, Germany
Contact:

Re: Building porblems with libxml

Post by Bjørn » 01 Apr 2008, 08:31

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, 23:02

Re: Building porblems with libxml

Post by sjoerd222 » 01 Apr 2008, 17:42

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

Re: Building porblems with libxml

Post by Jaxad0127 » 01 Apr 2008, 18:37

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

Re: Building porblems with libxml

Post by sjoerd222 » 01 Apr 2008, 20:36

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

Re: Building porblems with libxml

Post by Jaxad0127 » 01 Apr 2008, 22:00

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, 23:02

Re: Building problems with libxml

Post by sjoerd222 » 02 Apr 2008, 22:11

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
TMW Adviser
TMW Adviser
Posts: 4209
Joined: 01 Nov 2007, 18:35
Location: Internet

Re: Building problems with libxml

Post by Jaxad0127 » 03 Apr 2008, 00:13

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, 23:02

Re: Building problems with libxml

Post by sjoerd222 » 03 Apr 2008, 10:36

$ pkg-config --libs libxml-2.0
-lxml2
User avatar
Bjørn
TMW Adviser
TMW Adviser
Posts: 1430
Joined: 09 Dec 2004, 19:50
Location: North Rhine-Westphalia, Germany
Contact:

Re: Building problems with libxml

Post by Bjørn » 07 Apr 2008, 19:32

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, 23:02

Re: Building problems with libxml

Post by sjoerd222 » 07 Apr 2008, 23:20

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