gpt4 book ai didi

c++ - Ubuntu Eclipse libxml2 错误 : fatal error: libxml/xmlversion. h: No such file or directory

转载 作者:可可西里 更新时间:2023-11-01 15:32:00 27 4
gpt4 key购买 nike

我想在我的 eclipse 项目中使用 libxml2。我可以通过“

”在命令行上使用这个库

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

但是我不能在eclipse上使用。我添加了C++ Build->Setting->GCC C Compiler->Includes

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

但是当我构建我的项目时,我通过

得到一个错误

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

最佳答案

这是因为库不完整。您应该安装它们。

Here's one thread that might be helpful.

一个解决方案:

sudo apt-get install libxml2-dev libxslt1-dev

对于红帽/Centos/Fedora:

yum install libxml-devel

关于c++ - Ubuntu Eclipse libxml2 错误 : fatal error: libxml/xmlversion. h: No such file or directory,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23254475/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com