Skip to main content



      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 14:44 Go to next message
Eclipse UserFriend
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 14:47 Go to previous messageGo to next message
Eclipse UserFriend
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.

Re: Error with command: gdb --version Cannot run program "gdb": Unknown reason [message #1709078 is a reply to message #1709074] Wed, 23 September 2015 15:04 Go to previous messageGo to next message
Eclipse UserFriend
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 17:54 Go to previous messageGo to next message
Eclipse UserFriend
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 17:57] by 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 02:41 Go to previous messageGo to next message
Eclipse UserFriend
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 02:48 Go to previous message
Eclipse UserFriend
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: Thu Sep 25 19:11:45 EDT 2025

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

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

Back to the top