【问题标题】:GNU C compiler cannot locate header fileGNU C 编译器找不到头文件
【发布时间】:2011-10-20 14:52:36
【问题描述】:

我在我的机器上安装了一个软件包 libstree (x86_64/Redhat Linux)。

已按照说明 (./configure --prefix=/usr; make check; make install) 安装包。

已检查相关头文件是否在/usr/include/usr/lib 目录中。

但是,当我尝试编译测试程序时,我收到一条错误消息:

test.c:6:25: fatal error: lst_structs.h: No such file or directory
compilation terminated.

lst_structs.h 存在于/usr/include/stree 目录中。

有人对 GNU C 编译器为什么找不到头文件有任何想法吗?

【问题讨论】:

  • 您是否包含#include <stree/lst_structs.h>#include <lst_structs.h> 的文件?
  • 请说明您是如何包含该文件的。
  • 你是#include <stree/lst_structs.h>,还是#include <lst_structs.h>

标签: c header compilation


【解决方案1】:

由于它位于 /include 子目录中,因此您需要明确提及它(参见上面的 cmets),或调整您的 lib 包含路径,如旧的 stackoverflow 帖子中所述: How to add a default include path for gcc in linux?

【讨论】:

    猜你喜欢
    • 2021-11-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-01-25
    • 2017-10-16
    • 1970-01-01
    相关资源
    最近更新 更多