问题
I am trying to step through my program and I get the following message from Code::Blocks
Selecting target:
Debug
ERROR: You need to specify a debugger program in the debuggers's settings.
(For MinGW compilers, it's 'gdb.exe' (without the quotes))
(For MSVC compilers, it's 'cdb.exe' (without the quotes))
Unfortunately, I cannot figure out where I would type in gdb.exe.
回答1:
In the Code::Blocks IDE, navigate Settings -> Debugger
In the tree control at the right, select Common -> GDB/CDB debugger -> Common.
Then in the dialog at the left you can enter Executable path and choose Debugger type = GDB or CDB, as well as configuring various other options.
回答2:
- Go to Settings -> Debugger -> Common -> GDB/CDB Debugger -> Default
- Click on
executable path
to find the address togdb32.exe
- Locate where your codeblock is installed
- Follow the given path:
CodeBlock -> MinGW -> bin -> gdb32.exe (locate it and double click on it)
- Press OK
回答3:
For Code::Blocks 17.12.
Visit http://wiki.codeblocks.org/index.php?title=MinGW_installation#TDM-GCC
Follow installation's instructions.
Alternatively I suggest this post.
Regards.
回答4:
Click on settings in top tool bar;
Click on debugger;
In tree, highlight "gdb/cdb debugger" by clicking it
Click "create configuration"
Add "gdb.exe" (no quotes) as a configuration
Delete default configuration
Click on
gdb.exe
that you created in the tree (it should be the only one) and a dialogue will appear to the right for "executable path" with a button to the right.Click on that button and it will bring up the file that codeblocks is installed in. Just keep clicking until you create the path to the
gdb.exe
(it sort of finds itself).
回答5:
Here is the tutorial to install GBD.
Usually GNU Debugger might not be in your computer, so you would install it first. The installation steps are basic "configure", "make", and "make install".
Once installed, try which gdb
in terminal, to find the executable path of GDB.
回答6:
Download codeblocks-13.12mingw-setup.exe instead of codeblocks-13.12setup.exe from the official site. Here 13.12 is the latest version so far.
回答7:
- Go to settings >> Debugger.
Now as you can see in the image below. There's a tree. Common->GDB/CDB Debugger -> Default.
Click on executable path (on the right) to find the address to gdb32.exe .
- Click gdb32.exe >> OK.
THATS IT!! This worked for me.
回答8:
Click on settings in top tool bar;
Click on debugger;
In tree, highlight "gdb/cdb debugger" by clicking it
Click "create configuration"
Click default configuration, a dialogue will appear to the right for "executable path" with a button to the right.
Click on that button and it will bring up the file that codeblocks is installed in. Just keep clicking until you create the path to the gdb.exe (it sort of finds itself).
来源:https://stackoverflow.com/questions/21083560/how-do-you-specify-a-debugger-program-in-codeblocks-12-11