0

I am having problems trying to run a c++ project in eclipse.

I found several pages with solutions, but none of them worked.

The program file specified in the launch configuration does not exist

Launch Failed. Binary not found. CDT on Eclipse Helios

The program compiles:

08:52:36 **** Build of configuration Debug for project testcpp ****
make all 
Building file: ../test.cpp
Invoking: Cross G++ Compiler
g++ -O0 -g3 -Wall -c -fmessage-length=0 -std=c++11 -MMD -MP -MF"test.d" -MT"test.d" -o "test.o" "../test.cpp"
Finished building: ../test.cpp

Building target: testcpp.exe
Invoking: Cross G++ Linker
g++ -pthread -o "testcpp.exe"  ./test.o   
Finished building target: testcpp.exe


08:52:38 Build Finished (took 1s.664ms)

And the file testcpp.exe is inside the debug folder, but when I run Run as -> Local C/c++ Application it shows the error Launch Failed. Binary not found.

The thing is I can just click Run and it works.

Any idea?

Eclipse version:

Eclipse IDE for C/C++ Developers

Version: Luna Service Release 1 (4.4.1) Build id: 20140925-1800

Platform: Windows 7 64bits.

Community
  • 1
  • 1
blfuentes
  • 2,731
  • 5
  • 44
  • 72
  • The text "Invoking: Cross G++ Compiler" makes me guess that you are making a program for another target, and not the native platform you are on. So when you try to run as a "local application" it tries to run the program as it was native, but its not. When you "Run" it you probably start it in an emulator of some kind.. Note that I'm only guessing, since I haven't used Eclipse in many years. – Some programmer dude Oct 31 '14 at 08:02
  • Which platform do you use? Cross compiling might make sense if it is g++ running on windows – Eric Oct 31 '14 at 08:05
  • Yes, I am running on windows and target cross g++ because it was the only one I could manage to run with the -pthread. I will update the question with this info. – blfuentes Oct 31 '14 at 08:06

1 Answers1

1

A cheap hack could be to add your debug folder to your PATH environment variable. That way eclipse will check that path for binaries as well.

If somebody else wrote the makefile (not eclipse) then the debug path might not be known by eclipse. Try to specify the full path you want to launch

Eric
  • 19,525
  • 19
  • 84
  • 147
  • Thanks. This worked, but is this the proper way to do it? Or should I configure eclipse in a special way? – blfuentes Oct 31 '14 at 08:13
  • 1
    I dont have any eclipse app at hand but in the run as there is a place where you specify where your binaries should be. It really depends on how your project was created – Eric Oct 31 '14 at 08:33