Eclipse将无法运行C程序 [英] Eclipse will not run C programs

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

问题描述

我最近在Windows 8中为Eclipse安装了CDT插件,但出现错误:

启动失败.找不到二进制文件."

现在,我已经研究了这一点,并在gcc中安装了cygwin,并在Eclipse设置中进行了设置.我去了 Window> Preferences> New C/C ++项目向导> Makefile 项目并检查了Cygwin PE Parser(以防万一我也检查了PE Windows Parser).

然后我转到 Window> Preferences> Build> Environment 并在其中添加我的PATH变量.我确保在系统设置中将 C:\ cygwin64 \ bin 添加到我的PATH中,并且我知道这是有效的,因为我检查了该位置并成功运行了 gcc 通过命令行以及 cygwin 终端.最重要的是,如果我在Eclipse中构建项目,然后导航到Eclipse之外的该目录并运行通过双击它创建的 .exe ,它也将正常运行.

我不知道为什么Eclipse无法运行它,但其他一切都可以...有什么建议吗?

解决方案

在eclipse中右键单击您的项目"projectexplor"->运行方式->运行配置=>选择您的项目名称,然后在C/C ++应用程序文件中选中主要"选项卡.它指向您的二进制文件吗?例如:Debug/TestProj.exe

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?

解决方案

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

这篇关于Eclipse将无法运行C程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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