Reputation: 97
I am in the process of porting my windows console application to Linux (Ubuntu 12.04). I am using the GNU GCC compiler to compile my application. However I can't seem to get rid of some errors, this code does function in windows with libxml2 but can't compile here.
In my build options I have included to search the path usr/include/libxml2. When I compile i still recieve the error:
Datadictionary.c|| undefined reference to `xmlCheckVersion'|
Datadictionary.c|| undefined reference to `xmlStrcmp'|
Datadictionary.c|| undefined reference to `xmlGetProp'|
Datadictionary.c|| undefined reference to `xmlReadFile'|
Now i have looked anywhere but could not find a solution.
Please help.
Upvotes: 0
Views: 1599
Reputation: 13
You need to install
sudo apt-get install libxml2
sudo apt-get install libxml2-dev
sudo apt-get install libxslt-dev
sudo apt-get install xml-core
Then you need to set compliler option -I/usr/include/libxml2
and linker option -lxml2 -lm
And use # include<libxml/parser.h> instead #include "libxml/parser.h"
Also you need to clear all previous search path settings
Upvotes: 1