Ubuntu 13.04/CentOS 6.4 下C++开发时的相关设置(2)

新建项目后,点击run>>run configurations,双击左侧一列的c/c++ local applation,新建一个运行配置,在main中点击Browse选择你的项目,在common中勾选“debug”和“run”,这样就好使了。

I even faced this error and searched a lot to fix. Fortunately, I figured it out myself.

The following are the things you need to make sure they are set:

Windows > Preferences > C/C++ > New CDT project wizard > Makefile Project > Binary Parsers

a) Set it to Windows PE Parser if you are on windows.

b) Set it to Cygwin PE Parser if you are using Cygwin

Windows > Preferences > C/C++ > Environment

Now click on "select" and select "Path" variable so that you add you path variables in Eclipse.

Now its all done!

All you have to do is write a test program and press Ctrl+B (Build all; there is a button on menu bar) and after that click "Run".

After all the setup is done.Go to eclipse project --> build all or ctrl + B then eclipse automatically build up the binaries and other stuffs now run your project

Linux平台下用Eclipse编写C++程序出错!

所用环境是Fedora16 + GCC + Eclipse CDT,可是我随便写个简单的程序,编译,总是提示:“Launch failed,binary not found”。请问如何解决?

1.已试过在“项目”——“属性”——“C++ Build”——“Settings”——“Binary Parses”里面勾选“GNU Elf Parses”和“PE Windows Parses”,仍然无用。

2.已试过在“窗口”——“首选项”——“C/C++”——“New CDT Project Wizard”——“Makefile Project”——“Binary Parses”里面勾选“GNU Elf Parses”和“PE Windows Parses”,还是无用。

3.已试过先按Ctrl+B编译后再运行,无用。

4.已试过文件名加上后缀.cpp和.c,无用。

Project->Properties->C/C++Build->Settings->Binary Parsers

勾选GNU Elf Parser和Elf Parser

然后千万千万别忘了Project->Build All (Ctrl+B), 再run(Ctrl+F11)

如果看到项目下面出来一项名为Binaries, Congradulations! 配置成功,可以run了!

3、还不行?

检查你的文件名是否为xxx.cpp? 而且xxx中不能含有“.”之类的符号

新建了一个项目后,Ctrl+F11可以运行,但只要 ,然后再Ctrl+F11运行,出现"launch failed.Binary not found"错误,解决方法如下:

新建项目后,点击run>>run configurations,双击左侧一列的c/c++ local applation,新建一个运行配置,在main中点击Browse选择你的项目,在common中勾选“debug”和“run”,这样就好使了。

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/18746.html