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: 742
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 messageGo to next 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

Re: (Solved) Re: Error with command: gdb --version Cannot run program "gdb": Unknown reaso [message #1826366 is a reply to message #1709093] Fri, 24 April 2020 06:41 Go to previous messageGo to next message
Sam Warner is currently offline Sam WarnerFriend
Messages: 40
Registered: April 2020
Member
Took me forever to get GDB to couple with eclipse on Catalina. The two sets of instructions I finally end up using that work were:
Configuration: Catalina, Version: 2020-06 (4.16), and GDB 9.1

1) https: (couldn't include a link, so cut/past this to recreate)
//superuser.com/questions/1436370/how-to-codesign-gdb-on-os-x-mojave
2) and when one gets to the "set entitlement" stage, use the root account

Debugging like a pro now, with GDB
Sam
Re: Error with command: gdb --version Cannot run program "gdb": Unknown reason [message #1826367 is a reply to message #1709073] Fri, 24 April 2020 06:48 Go to previous message
Sam Warner is currently offline Sam WarnerFriend
Messages: 40
Registered: April 2020
Member
I had the same problem when I loaded
Catalina,
Eclipse Version: 2020-06 (4.16)
GDB, 9.1

I finally had to follow these instructions, which weren't all that easy to find, and differ slightly from above. (remove the spaces, as this is my first post and I wast stopped from posting links)

1). https: //superuser.com /questions
/1436370/how-to-codesign-gdb-on-os-x-mojave

2) enable root to set the self-signed-cert & entitlement for GDB
3) disable root after

Sam
Previous Topic:Serial Terminal
Next Topic:Cannot debug cmake project
Goto Forum:
  


Current Time: Tue Apr 16 21:35:41 GMT 2024

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

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

Back to the top