【问题标题】:Build error using C++ Eclipse使用 C++ Eclipse 构建错误
【发布时间】:2015-09-12 01:58:10
【问题描述】:

我使用 MinGW 和 MSYS 为 C++ 配置了我的 Eclipse Helios。我将相同的内容添加到 PATH 变量中。但是我无法使用 Eclipse 构建。下面的错误消息本身信息很少:

Build of configuration Debug for project Test
Internal Builder is used for build               
g++ -IC:\MinGW\lib\gcc\mingw32\4.8.1\include\c++ -O0 -g3 -Wall -c -fmessage-length=0 -osrc\Test.o ..\src\Test.cpp
Build error occurred, build is stopped
Time consumed: 220  ms.

我可以从命令行使用 make/g++。

谢谢

启用“不因错误而失败”设置后的更多日志:

**** Rebuild of configuration Debug for project Test ****

**** Internal Builder is used for build               ****
g++ -IC:\MinGW\lib\gcc\mingw32\4.8.1\include\c++ -O0 -g3 -Wall -c -fmessage-length=0 -osrc\Test.o ..\src\Test.cpp
g++ -oTest.exe src\Test.o
g++: error: src\Test.o: No such file or directory
g++: fatal error: no input files
compilation terminated.
Build completed with errors
Time consumed: 337  ms.  

【问题讨论】:

  • 只是为了确定一下,您是如何“将相同的内容添加到 PATH 变量中”的?通常我将用户环境变量设置为mingw\bin。
  • 我没有看到 实际 错误是什么 - 是类似 g++ not found 还是其他错误?
  • 这是我能看到的最大错误轨迹。如何启用更多日志记录以获取错误跟踪。
  • 我在 PATH 变量中添加了以下内容 C:\MinGW\bin;C:\MinGW\msys\1.0\bin;
  • 在这里发帖是因为我有类似的错误,但很难找到原因。我在 Eclipse 设置中有"some\windows\path\"。路径中最后一个不必要的反斜杠使链接器/编译器命令带有转义的",这使命令的其余部分成为未完成的字符串。该死的 MS,我讨厌他们的反斜杠路径。

标签: c++ eclipse build makefile mingw


【解决方案1】:

尝试在 2 g++ 命令行中分隔“-o”和文件名。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-09-13
    • 1970-01-01
    • 1970-01-01
    • 2017-03-23
    • 1970-01-01
    • 2012-12-19
    • 2015-06-10
    • 1970-01-01
    相关资源
    最近更新 更多