简体   繁体   English

Eclipse将无法运行C程序

[英]Eclipse will not run C programs

I just recently installed the CDT plugin for Eclipse in Windows 8 and I'm getting the error: 我刚刚在Windows 8中为Eclipse安装了CDT插件,但出现错误:

"Launch failed. Binary not found." “启动失败。找不到二进制文件。”

Now I've looked into this and I have installed cygwin with gcc and set that up in Eclipse settings. 现在,我对此进行了研究,并用gcc安装了cygwin并在Eclipse设置中进行了设置。 I went to Window>Preferences>New C/C++ Project Wizard>Makefile Project and checked Cygwin PE Parser (and just in case I checked PE Windows Parser as well). 我去了Window>Preferences>New C/C++ Project Wizard>Makefile Project,并检查了Cygwin PE Parser(以防万一我也检查了PE Windows Parser)。

Then I went to Window>Preferences>Build>Environment and added my PATH variable there. 然后我去了Window>Preferences>Build>Environment并在其中添加了PATH变量。 I made sure to add C:\\cygwin64\\bin to my PATH in my system settings, and I know this is valid because I checked that location and I have successfully run gcc through the command line as well as the cygwin terminal. 我确保在系统设置中将C:\\cygwin64\\bin添加到PATH中,并且我知道这是有效的,因为我检查了该位置,并且已通过命令行以及cygwin终端成功运行了gcc On top of this, if I build my project in Eclipse and then navigate to that directory outside of Eclipse and run the .exe that it creates by double-clicking on it, it also runs properly. 最重要的是,如果我在Eclipse中构建我的项目,然后导航到Eclipse之外的该目录并通过双击运行它创建的.exe ,它也将正常运行。

I'm at a loss for why Eclipse can't run it but everything else can...Any suggestions? 我不知道为什么Eclipse无法运行,但是其他一切都可以...有什么建议吗?

right click your project in eclipse "project explore" -> Run as -> Run configuration =>select your project name then check "Main" tab, in C/C++ application file. 在eclipse中右键单击您的项目“ projectexplor”->运行方式->运行配置=>选择您的项目名称,然后在C / C ++应用程序文件中选中“ Main”选项卡。 is it point to your binary file? 它指向您的二进制文件吗? Eg: Debug/TestProj.exe 例如:Debug / TestProj.exe

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM