Eclipse will not run C programs

倖福魔咒の 提交于 2021-02-11 17:29:45

问题


I just recently installed the CDT plugin for Eclipse in Windows 8 and I'm getting the error:

"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. 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).

Then I went to Window>Preferences>Build>Environment and added my PATH variable there. 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. 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.

I'm at a loss for why Eclipse can't run it but everything else can...Any suggestions?


回答1:


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. is it point to your binary file? E.g: Debug/TestProj.exe



来源:https://stackoverflow.com/questions/18627468/eclipse-will-not-run-c-programs

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!