Ubuntu Eclipse libxml2错误:fatal错误:libxml / xmlversion.h:没有这样的文件或目录 [英] Ubuntu Eclipse libxml2 error : fatal error: libxml/xmlversion.h: No such file or directory
问题描述
我想在我的eclipse项目中使用libxml2。我可以在命令行使用这个库
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 $但是我不能在eclipse上使用。我添加了C + + Build-> Setting-> GCC C Compiler-> B $ b
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
并且我添加C ++ Build-> Setting-> GCC C ++ Linker->库
-lxml2
-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错误:libxml / xmlversion.h:没有这样的文件或目录
libxml/parser.h:15:31: fatal error: libxml/xmlversion.h: No such file or directory
推荐答案
这是因为libs不完整。您应该安装它们。
This is because libs are not complete. You should install them.
Here's one thread that might be helpful.
一个解决方案: p>
One solution:
sudo apt-get install libxml2-dev libxslt1-dev
对于Redhat / Centos / Fedora:
For Redhat/Centos/Fedora:
yum install libxml-devel
这篇关于Ubuntu Eclipse libxml2错误:fatal错误:libxml / xmlversion.h:没有这样的文件或目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!