gcc c++ 发生 make 错误带有 mingw 链接器的编译器
实际上在我的 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这实际上不是 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
).删除
-fmessage-length=0,
中的尾随逗号Remove trailing comma from
-fmessage-length=0,