User forums > Using Code::Blocks

[SOLVED] libxml2 include header files directory

<< < (2/2)

cbuser2:
Oh yes, I am trying to use the limxml2 html parsing library, in linux. So if anyone has managed to do this, including setting up the header directories in CB, I'd really like to know what your settings are in CB.

cbuser2:
Ok, problem solved, by reading the FAQ properly: http://www.xmlsoft.org/FAQ.html#Installati

"Troubles compiling or linking programs using libxml2

Usually the problem comes from the fact that the compiler doesn't get the right compilation or linking flags. There is a small shell script xml2-config which is installed as part of libxml2 usual install process which provides those flags. Use

xml2-config --cflags

to get the compilation flags"


--- Code: ---mycomputer$ xml2-config --cflags
-I/usr/include/libxml2

--- End code ---



And for those who have trouble with setting up the linker library, the library file ends in .so, and since I am using 64 bit linux.


--- Code: ---mycomputer$ locate libxml2.so
/usr/lib/i386-linux-gnu/libxml2.so.2
/usr/lib/i386-linux-gnu/libxml2.so.2.7.8
/usr/lib/x86_64-linux-gnu/libxml2.so
/usr/lib/x86_64-linux-gnu/libxml2.so.2
/usr/lib/x86_64-linux-gnu/libxml2.so.2.7.8

--- End code ---



Thanks for your replies, stahta01.

Jenna:
The best solution is in my opinion to use `xml2-config --cflags` and `xml2-config --libs` (note the backticks) in the compilers/linkers other options tab.

Navigation

[0] Message Index

[*] Previous page

Go to full version