Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Error with command: gdb --version Cannot run program "gdb": Unknown reason(Build Project does not create .exe file, Debug gives the error 'Cannot run 'gdb'.)
Error with command: gdb --version Cannot run program "gdb": Unknown reason [message #1709073] Wed, 23 September 2015 18:44 Go to next message
Diana Popova is currently offline Diana PopovaFriend
Messages: 7
Registered: June 2015
Junior Member
Eclipse Luna on Mac Yosemite, CDT, XCode7.
HelloWorld with makefile:
- Copied from Eclipse Tutorial main.cpp and makefile for HelloWorld;
- Ran 'Build Project' and got the console:
"
11:39:25 **** Build of configuration Debug for project HelloWorldMakefile ****
make all
Building file: ../main.cpp
Invoking: GCC C++ Compiler
g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"main.d" -MT"main.d" -o "main.o" "../main.cpp"
Finished building: ../main.cpp

Building target: HelloWorldMakefile
Invoking: MacOS X C++ Linker
g++ -o "HelloWorldMakefile" ./main.o
Finished building target: HelloWorldMakefile


11:39:25 Build Finished (took 330ms)
"
- Tried to run Debug, and got the error that 'gdb' cannot run.
Question:
Why no .exe file was built?
Re: Error with command: gdb --version Cannot run program "gdb": Unknown reason [message #1709074 is a reply to message #1709073] Wed, 23 September 2015 18:47 Go to previous messageGo to next message
Tauno Voipio is currently offline Tauno VoipioFriend
Messages: 424
Registered: August 2014
Senior Member
Diana Popova wrote on Wed, 23 September 2015 21:44
Eclipse Luna on Mac Yosemite, CDT, XCode7.
HelloWorld with makefile:
- Copied from Eclipse Tutorial main.cpp and makefile for HelloWorld;
- Ran 'Build Project' and got the console:
"
11:39:25 **** Build of configuration Debug for project HelloWorldMakefile ****
make all
Building file: ../main.cpp
Invoking: GCC C++ Compiler
g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"main.d" -MT"main.d" -o "main.o" "../main.cpp"
Finished building: ../main.cpp

Building target: HelloWorldMakefile
Invoking: MacOS X C++ Linker
g++ -o "HelloWorldMakefile" ./main.o
Finished building target: HelloWorldMakefile


11:39:25 Build Finished (took 330ms)
"
- Tried to run Debug, and got the error that 'gdb' cannot run.
Question:
Why no .exe file was built?


--

1. The run files on OS X are not .exe files, but files without a specific extension.

2. The XCode packege does not use GDB as standard debugger. You have to install it into the system separately.

3. It seems that your run firl has been built under the name HelloWorldMakefile.



--

Tauno Voipio
Re: Error with command: gdb --version Cannot run program "gdb": Unknown reason [message #1709078 is a reply to message #1709074] Wed, 23 September 2015 19:04 Go to previous messageGo to next message
Diana Popova is currently offline Diana PopovaFriend
Messages: 7
Registered: June 2015
Junior Member
Thank you, Tauno. Will try to find and install GDB on my Mac.
(Solved) Re: Error with command: gdb --version Cannot run program "gdb": Unknown reason [message #1709093 is a reply to message #1709078] Wed, 23 September 2015 21:54 Go to previous message
Diana Popova is currently offline Diana PopovaFriend
Messages: 7
Registered: June 2015
Junior Member
Installed GDB with Homebrew, signed the certificate, changed the Run/Debug Configurations, entered the location of GDB in Preferences/C/C++ /Debug/GDB, and voila! It works!
Thank you again, Tauno.

[Updated on: Wed, 23 September 2015 21:57]

Report message to a moderator

Previous Topic:Remote Run/Debug: slow login (via TCF) (echo $PWD)
Next Topic:CTRL+D not sending EOF
Goto Forum:
  


Current Time: Thu Nov 15 14:17:54 GMT 2018

Powered by FUDForum. Page generated in 0.03376 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top