c++ - G++ 不清楚的编译失败

标签 c++ gcc compilation makefile g++

大家好。这是我关于 stackoverflow 的第一个问题。我用谷歌搜索并把这个东西咬死了,但没有一次成功。我正在尝试在 Mint 17 上用 g++ 编译一个 c++ 库。我收到了一条令人沮丧的不清楚的失败消息。我想知道以前是否有人遇到过这种情况。我意识到它看起来像一个丢失的包含,奇怪的是指出为故障点和信息缺失的位置。通常编译器指定它找不到哪个文件。请看下面的消息。任何建议将不胜感激。

"/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make[1]: Entering directory `/home/bfvanrooyen/Projects/Management Console/Event Monitor'
cd ../Perlingo\ Library && /usr/bin/make  -f Makefile CONF=Debug
make[2]: Entering directory `/home/bfvanrooyen/Projects/Management Console/Perlingo Library'
"/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make[3]: Entering directory `/home/bfvanrooyen/Projects/Management Console/Perlingo Library'
"/usr/bin/make"  -f nbproject/Makefile-Debug.mk dist/Debug/GNU-Linux-x86/libbham_dev.so
make[4]: Entering directory `/home/bfvanrooyen/Projects/Management Console/Perlingo Library'
mkdir -p build/Debug/GNU-Linux-x86/src
rm -f "build/Debug/GNU-Linux-x86/src/BhamEvent.o.d"
g++ -m32   -c -g -Wall -Iinclude -Isrc -I../Perlingo\ Shared\ Objects -include include -fPIC  -MMD -MP -MF "build/Debug/GNU-Linux-x86/src/BhamEvent.o.d" -o build/Debug/GNU-Linux-x86/src/BhamEvent.o src/BhamEvent.cpp
In file included from <command-line>:0:0:
/usr/include/stdc-predef.h:59:1: fatal error: include: No such file or directory
 #endif
 ^
compilation terminated.

最佳答案

您的选项 -include include 告诉 g++ 包含一个名为“include”的文件。根据 g++ 无法找到该文件,因此出现错误。您确定 -include include 不仅仅是某种复制和粘贴错误吗?

当对所有这些标志和参数的作用有疑问时,您可以在 gcc 文档中找到完整列表 here .

关于c++ - G++ 不清楚的编译失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25051778/

相关文章:

linux - 如何回显编译状态?

c++ - 在 C++ 中定义类枚举值的 std::vector 的缩写语法

c - 重新初始化已在其他源文件中定义的全局变量

c - open() 上的 Hook 导致的段错误

ios - 如何用Xcode从苹果源代码编译CoreFoundation?

linux - ubuntu make 显示完整命令

c++ - 计算两个 uint8_t 变量之间差异的最快方法是什么?

c++ - 无法将 Wifly 连接到 Arduino

c++ - 如何将 vector 中的可变参数转换为它是参数的持有者?

c - 某些 GCC 编译器如何修改常量 char 指针?