Eclipse CDT project built but “Launch Failed. Bina

2019-01-17 15:13发布

Windows 7, Eclipse CDT, Juno Service Release 2, Cross compiler.

Projects do compile executables generated, but Eclipse can't see them; therefore 'Run' fails. Executables are placed in Debug directory. Double click or command prompt call on compiled executable works without problem.

enter image description here

How can I solve this?

13条回答
Explosion°爆炸
2楼-- · 2019-01-17 15:28

I think I found solution - proper binary parser must be selected so Eclipse can recognize the executable:

Select the project, then right-click. Project->Properties->C/C++ Build->Settings->Binary Parsers, PE Windows Parser.

I.e. if Cygwin compiler is used then Cygwin parser should be used.

That worked for me at least for Cross-compiler (both on Windows 7 and Ubuntu 12.04). On Linux, I use Elf parser.

If anyone has the better solution, please advise.

查看更多
beautiful°
3楼-- · 2019-01-17 15:28

After trying everything here what worked for me was to grant execution permission to eclipse:

cd eclipse-installation-dir 
sudo chmod +x eclipse

Using Eclipse Luna on Ubuntu 12.04 LTS.

查看更多
家丑人穷心不美
4楼-- · 2019-01-17 15:31

This happened to me and I found a solution, see if this works for you:

Once you have built your project with the hammer icon:

  1. select "Run".
  2. Run Configurations.
  3. Choose "C++ Application".
  4. Click on the "New Launch Configuration" icon on the top left of the open window.
  5. Select "Browse" under the C/C++ Application.
  6. Browse to the folder where you made your project initially.
  7. Enter the Debug folder.
  8. Click on the binary file with the same name as the project.
  9. Select "OK".
  10. Click "Apply" to confirm the link you just set.
  11. Close that window.

Afterwards you should be able to run the project as much as you'd like.

Hopefully this works for you.

查看更多
疯言疯语
5楼-- · 2019-01-17 15:39

For what it's worth, I had this problem - and the cause was invalid DWARF 3 info in the binary in the selected project (which didn't have any runnable binaries).

The way it work was something like this: I had two projects Main and Library. Main depended on the Library project and the former had an executable, while the latter just produced a static library (that Main linked against).

My run option was set to "Run/Debug -> Launch" setting was set to "launch current, otherwise last" as follows (see bottom right):

Run/Debug settings

If I had the Main project selected, everything would work fine: it would launch the main project. If I had the Library project selected1 it would fail with the error message given by the OP. The reason seemed to be this: since I had the Library project selected, the PE scanner would scan the binary files in the project to see if any were launchable, and because scanning was failing due to this bug the error message popped up before it ever got to "Launch the previously launched application".

I could work around it by:

  1. Making sure the project I wanted to launch was selected, or ...
  2. Changing compilers to one that made DWARF info that Eclipse could parse without failure, or ...
  3. Selecting "Always launch the previously launched application" in the Run/Debug settings - although it might not be your preferred mode of operation.

1 I wouldn't usually select the project directly, of course, it would be indirectly selected because I was working in one of the source files it contained.

查看更多
放荡不羁爱自由
6楼-- · 2019-01-17 15:40

Simply select the project and press CTRL + B.

查看更多
再贱就再见
7楼-- · 2019-01-17 15:40

You need to click on the MinGW compiler when running the code. Failure to do this will cause the launch failed binary not found error.

查看更多
登录 后发表回答