gcc c++ 发生 make 错误带有 mingw 链接器的编译器

发布于 2024-08-17 21:41:47 字数 503 浏览 2 评论 0原文

实际上在我的 gcc c++ 编译器中为项目测试用例构建配置版本

make all 
Building file: ../atest.cpp
Invoking: GCC C++ Compiler
g++ -I"C:\cppunit\include" -I"C:\cppunit\include\cppunit\extensions" -I"C:\mingw\bin" -O3 -Wall -c -fmessage-length=0, -Wl,-subsystem,console -MMD -MP -MF"atest.d" -MT"atest.d" -o"atest.o" "../atest.cpp"
cc1plus.exe: error: argument to "-fmessage-length=" should be a non-negative integer
make: *** [atest.o] Error 1

有 -c -fmessage-length=0 这个标志已经给出,但我的控制台窗口显示上述错误

Build of configuration Release for project testcase

make all 
Building file: ../atest.cpp
Invoking: GCC C++ Compiler
g++ -I"C:\cppunit\include" -I"C:\cppunit\include\cppunit\extensions" -I"C:\mingw\bin" -O3 -Wall -c -fmessage-length=0, -Wl,-subsystem,console -MMD -MP -MF"atest.d" -MT"atest.d" -o"atest.o" "../atest.cpp"
cc1plus.exe: error: argument to "-fmessage-length=" should be a non-negative integer
make: *** [atest.o] Error 1

actually in my gcc c++ compller has -c -fmessage-length=0 this flag has been given but my in console window showing above error

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

挖个坑埋了你 2024-08-24 21:41:47

这实际上不是 make 错误。 make 运行其他命令(例如 g++)来实际构建项目。当这些命令之一出现错误时,make 将停止(除非明确告知忽略该错误)。

这似乎是 mingw 编译器中的一个错误。我已经在多个版本的 g++ 上尝试了 -fmessage-length=0 (Darwin/Mac 为 4.2.1,Linux 为 4.3.2),但没有一个版本发出该错误(我可以创建指定 -fmessage-length=-1 时出错)。

This is not actually a make error. make runs other commands (such as g++) to actually build the project. When one of those commands gives an error, make will stop (unless specifically told to ignore the error).

This appears to be a bug in mingw compiler. I've tried -fmessage-length=0 on multiple versions of g++ (4.2.1 for Darwin/Mac, 4.3.2 on Linux) and none of them issued that error (and I could create the error by specifying -fmessage-length=-1).

奢欲 2024-08-24 21:41:47

删除 -fmessage-length=0, 中的尾随逗号

Remove trailing comma from -fmessage-length=0,

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文