0

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.

4

1 回答 1

1

你需要安装

sudo apt-get install libxml2
sudo apt-get install libxml2-dev
sudo apt-get install libxslt-dev
sudo apt-get install xml-core

然后你需要设置编译器选项 - I/usr/include/libxml2
和链接器选项-lxml2 -lm

并使用# include<libxml/parser.h> instead #include "libxml/parser.h"

您还需要清除所有以前的搜索路径设置

于 2013-09-06T10:11:55.927 回答