Reputation: 1964
I am trying to run a C++ project in Eclipse Neon (on Linux) in debug mode and I am getting a weird error I can find no reference to.
This is what I see in the console after right clicking Debug As >> Local C/C++ Application:
&"Cannot exec -c exec /correct/path/to/executable .\n"
&"Error: No such file or directory\n"
The application otherwise builds and runs fine. I can right click and Run As >> Local C/C++ Application. What is causing this error?
Edit:
I have found out some more info which appears to be on the right track. This question and answer (https://unix.stackexchange.com/questions/167918/gdb-cannot-exec-my-test-program) talks about setting the SHELL environment. My default shell is bash.
If I run my program in GDB through the command line it gives the same error as Eclipse, but without the \n:
Cannot exec -c exec /correct/path/to/executable .
Error: No such file or directory
If I then type SHELL=/bin/sh
or SHELL=/bin/bash
and run GDB again it debugs fine. I also have an old version of Eclipse installed on my computer which was being used for another project. This version has no problem running programs in debug and as far as I can tell all the debug settings are the same.
This problem is the same across all executables, even if I just build a simple C hello world program.
Upvotes: 0
Views: 2091
Reputation: 1964
I followed the instruction in this post (https://unix.stackexchange.com/questions/167918/gdb-cannot-exec-my-test-program) again. Do it all with Eclipse closed, re-boot, open Eclipse and clean all, re-build indexes and build everything. Can now de-bug properly.
Upvotes: 1