Eclipse CDT错误:无法编译 [英] Eclipse CDT error: Unable to compile

查看:252
本文介绍了Eclipse CDT错误:无法编译的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图运行一个简单的Hello World程序。我在尝试构建它时遇到此错误。这是什么意思,我该如何解决?我正在使用Windows 7,并且在%PATH%中有MinGW和MSys。

  ****配置的构建调试项目学习**** 

****内部构建器用于构建****
g ++ -IC:\MinGW\lib\gcc\mingw32\ 4.5.2 \include\c ++ -IC:\MinGW\libexec\gcc\mingw32\4.5.2 -O0 -g3 -Wall -c -fmessage-length = 0 -osrc\learn.o ..\src\learn.cpp
g ++:CreateProcess:没有这样的文件或目录
发生构建错误,构建停止
耗时:78 ms。

代码:

  #include< iostream> 

int main()
{
std :: cout<< 你好,世界! <<的std :: ENDL;
返回0;
}

我的%PATH%是:

  C:\ Users \Hari> echo%PATH%
C:\程序文件(x86)\MiKTeX 2.8 \miktex \bin ; C:\sml\bin; C:\Windows\system32; C:\Windows; C:\Windows\System32\Wbem; C:\Windows\System32\WindowsPowerShell\ v1.0 \; C:\ Program Files \WIDCOMM\Bluetooth Software\; C:\ Program Files \WIDCOMM\Bluetooth Software\syswow64; C:\程序文件(x86)\ ATI Technologies \ATI.ACE\Core-Static; C:\ Program Files(x86)\ Common Files \Roxio Shared\10.0\DLLShared\; C:\ Program Files(x86)\ Common Files \Roxio Shared \DLLShared \; C:\strawberry\c\bin; C:\strawberry\perl\site\bin; C:\strawberry\perl\bin ; C:\ Program Files(x86)\QuickTime\QTSystem\; G:\svn\bin; C:\ Program Files \Tor toiseSVN\bin; C:\程序文件\SlikSvn\bin\; C:\cygwin\bin\; C:\程序文件\apache-maven-2.2.1\bin\\ \\; C:\PsTools; C:\MinGW\msys\1.0\bin; C:\MinGW\bin

我可以从cmd运行g ++:

  C:\Users\ Hari> g ++ --version 
g ++(GCC)4.4.3
Copyright(C)2010 Free Software Foundation,Inc.
这是免费软件;请参阅复制条件的来源。没有任何b $ b保修;甚至不适用于适销性或针对特定用途的适用性。


解决方案

我发现C HelloWorld调用MinGW gcc编译器。经过相当多的实验后,我发现MinGW binutils软件包是应该受到指责的!由于某种原因,最新的一款不适合CDT。 )



binutils-2.21-2-mingw32-bin.tar.lzma



注意:版本2.21-3和更高版本似乎有问题。



此外,最新的GDB 7.3似乎也挂起了。使用这一个:



gdb-7.2-1-mingw32-bin.tar.lzma



< PS:我甚至没有MinGW或MSYS的路径。只要MinGW在C:\ MinGW的东西似乎奇迹般地工作。


I tried to run a simple Hello world program. I am getting this error when I try to build it. What does it mean and how do I resolve it? I am using Windows 7 and I have MinGW and MSys in the %PATH%.

**** Build of configuration Debug for project learn ****

**** Internal Builder is used for build               ****
g++ -IC:\MinGW\lib\gcc\mingw32\4.5.2\include\c++ -IC:\MinGW\libexec\gcc\mingw32\4.5.2 -O0 -g3 -Wall -c -fmessage-length=0 -osrc\learn.o ..\src\learn.cpp
g++: CreateProcess: No such file or directory
Build error occurred, build is stopped
Time consumed: 78  ms.  

Code:

#include <iostream>

int main()
{
    std::cout << "Hello, world!" << std::endl;
    return 0;
}

My %PATH% is:

C:\Users\Hari>echo %PATH%
C:\Program Files (x86)\MiKTeX 2.8\miktex\bin;C:\sml\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\WIDCOMM\Bluetooth Software\;C:\Program Files\WIDCOMM\Bluetooth Software\syswow64;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files (x86)\Common Files\Roxio Shared\10.0\DLLShared\;C:\Program Files (x86)\Common Files\Roxio Shared\DLLShared\;C:\strawberry\c\bin;C:\strawberry\perl\site\bin;C:\strawberry\perl\bin;C:\Program Files (x86)\QuickTime\QTSystem\;G:\svn\bin;C:\Program Files\TortoiseSVN\bin;C:\Program Files\SlikSvn\bin\;C:\cygwin\bin\;C:\Program Files\apache-maven-2.2.1\bin\;C:\PsTools;C:\MinGW\msys\1.0\bin;C:\MinGW\bin

I am able to run g++ from cmd:

C:\Users\Hari>g++ --version
g++ (GCC) 4.4.3
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

解决方案

I found the same problem with a C HelloWorld invoking the MinGW gcc compiler. After quite a bit of experimentation, I have found that the MinGW binutils package is to blame! The latest one doesn't play nice with CDT for some reason. Use this one instead and it will work :)

binutils-2.21-2-mingw32-bin.tar.lzma

NOTE: versions 2.21-3 and later seem to have the problem.

Additionally, the latest GDB 7.3 seems to hang too. Use this one:

gdb-7.2-1-mingw32-bin.tar.lzma

Happy coding :)

PS: I don't even have MinGW or MSYS in the path. As long as MinGW is in C:\MinGW things seem to magically work.

这篇关于Eclipse CDT错误:无法编译的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆