【问题标题】:c++ ERROR libxml++ no such file or directoryc++ ERROR libxml++没有这样的文件或目录
【发布时间】:2011-05-16 06:51:16
【问题描述】:

嗨,

我有以下内容:#include <libxml++/libxml++.h>,当我编译它时显示fatal error: libxml++/libxml++.h.No such file or directory。我已经检查了目录:/usr/include/libxml++-2.6/libxml++,它就是 libxml++.h。我哪里错了?为什么我会收到此错误?谢谢

编辑:

我确实包含了 g++ prg.cpp -o prg -I/usr/include/libxml++-2.6/ 现在我有了

error:fatal error: glibmm/ustring.h: No such file or directory

【问题讨论】:

  • 你的 g++ 命令行中有-I /usr/include/libxml++-2.6 吗?

标签: c++ ubuntu


【解决方案1】:

您应该使用 pkg-config 来获得正确的编译器选项。参见,例如: http://developer.gnome.org/libxml++/stable/

【讨论】:

【解决方案2】:

在 makefile 中添加以下选项:

g++ <some options> -I/usr/include/libxml++-2.6 <some other options>  

g++ 中的-I 标志将出现在它之后的目录添加到include path。如果您不想使用该选项,则需要将#include&lt;libxml++-2.6/libxml++.h&gt; 替换为#include "absolute path to above header file"。请注意,使用-I 标志还允许您将#include 之后的" " 替换为&lt; &gt; 标记。

【讨论】:

    【解决方案3】:

    编译时添加-I/usr/include/libxml++-2.6/libxml++

    【讨论】:

    • 我确实在我的代码中包含了您的链接(我不必包含 libxml++),但现在我遇到了错误:致命错误:glibmm/ustring.h:没有这样的文件或目录
    猜你喜欢
    • 1970-01-01
    • 2014-12-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-05-31
    • 1970-01-01
    • 2013-07-28
    • 1970-01-01
    相关资源
    最近更新 更多