Random thoughts shooting out of volatile mind
Installing libxml on Ubuntu
These day i've been working more on the XML files and I really love working with XML files. Libxml is one real good library out there for XML parsing and Creation. It was basically written as XML parser tool kit for GNOME but it can also be used outside the GNOME environment. It has been ported to wide variety of languages but it was basically written in C. In this post i'm just going to tell how to install the libxml on Debian based distro's.

For writing programs using libxml and compiling you need libxml2-dev package to be installed on your machine. To install the libxml2-dev use the following command

sudo apt-get install libxml2-dev

To compile your program with gcc you need to provide the linker flags to find out about compilation and linker flags libxml2 comes with a handy tool called xml2-config.

To print the pre-processor and compiler flags use the following command

xml2-config --cflags

To print the library linking information use the following command

xml2-config --libs

The linker option for gcc will be -lxml2. In my next post i'll be writing on how to create a simple XML file using libxml library, till then C'ya folks. :)
Posted by: copyninja on Sunday, 3 January 2010

blog comments powered by Disqus
Fork me on GitHub