Eclipse C/C++ (CDT) import files into project - header file not found - include path(Eclipse C/C++ (CDT) 将文件导入项目 - 找不到头文件 - 包含路径)
问题描述
我正在尝试将文件导入 Eclipse C 项目并进行编译.构建过程找不到本地头文件.头文件位于 src 目录中.如何在 Eclipse 中编辑包含路径?如果我手动操作,我可以在 gcc 中指定 -I 选项.
I am trying to import files into an Eclipse C project and compile it. The build process cannot find the local header files. The header files are located in the src directory. How can I edit the include path in eclipse? If I were doing it manually I could specify the -I option in gcc.
Building file: ../src/averaging.c
Invoking: GCC C Compiler
gcc -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/averaging.d" -MT"src/averaging.d" -o"src/averaging.o" "../src/averaging.c"
../src/averaging.c:2:23: fatal error: averaging.h: No such file or directory
compilation terminated.
make: *** [src/averaging.o] Error 1
推荐答案
- 右键单击项目并选择属性.
- 选择 C/C++ 常规 -> 路径和符号.
- 选择包含选项卡.
- 在语言列表中,选择GNU C"或您使用的任何 C 编译器工具链.
- 按添加..."按钮并添加包含文件的目录.
- 关闭属性窗口并重建.您应该会看到新路径在构建过程中被用作
-I
.
这篇关于Eclipse C/C++ (CDT) 将文件导入项目 - 找不到头文件 - 包含路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Eclipse C/C++ (CDT) 将文件导入项目 - 找不到头文件


- 如何使 JFrame 背景和 JPanel 透明且仅显示图像 2022-01-01
- 如何指定 CORS 的响应标头? 2022-01-01
- java.lang.IllegalStateException:Bean 名称“类别"的 BindingResult 和普通目标对象都不能用作请求属性 2022-01-01
- 获取数字的最后一位 2022-01-01
- Eclipse 的最佳 XML 编辑器 2022-01-01
- 未找到/usr/local/lib 中的库 2022-01-01
- 转换 ldap 日期 2022-01-01
- 在 Java 中,如何将 String 转换为 char 或将 char 转换 2022-01-01
- 将 Java Swing 桌面应用程序国际化的最佳实践是什么? 2022-01-01
- GC_FOR_ALLOC 是否更“严重"?在调查内存使用情况时? 2022-01-01