Ubuntu Eclipse libxml2 error : fatal error: libxml/xmlversion.h: No such file or directory

走远了吗. 提交于 2020-01-10 10:32:49

问题


I want to use libxml2 in my eclipse project. I can use this library on command line by "

g++ main.cpp -I/usr/include/libxml2 -lxml2 -o output "

But I can't use on eclipse.I add C++ Build->Setting->GCC C Compiler->Includes

-I/usr/include/libxml2 and I add C++ Build->Setting->GCC C++ Linker->library -lxml2

But When I build my project, I get an error via

libxml/parser.h:15:31: fatal error: libxml/xmlversion.h: No such file or directory


回答1:


This is because libs are not complete. You should install them.

Here's one thread that might be helpful.

One solution:

sudo apt-get install libxml2-dev libxslt1-dev

For Redhat/Centos/Fedora:

yum install libxml-devel


来源:https://stackoverflow.com/questions/23254475/ubuntu-eclipse-libxml2-error-fatal-error-libxml-xmlversion-h-no-such-file-or

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!