Jeremy Beare
Jeremy Beare

Reputation: 487

Installing MinGW's gdb.exe for Code Blocks

Hey guys I really need help.

I have recently started programming C++ again and I am trying to get Code Blocks up and running but it keeps failing because of this error.

"ERROR: You need to specify a debugger program in the debuggers's settings."

Understandably this means there isn't a debugger program so I have to download one. I tried to find the gdb.exe for MinGW but I can't find it at all. I just end up with the MinGW's Installation Manager and being left confused.

Are there any tutorials about using the MinGW written for beginners or anyone willing to help?

Thanks in advance.

Upvotes: 2

Views: 25957

Answers (3)

Masoud
Masoud

Reputation: 1

Hey guys I suggest a better way. Download "gdb.exe" from the Internet and copy it to the below path.

C:\MinGW\Bin

It's really works. I did it.

Upvotes: -1

George Theodosiou
George Theodosiou

Reputation: 353

Please let me suggest you debugger program TDM-GCC. For download and install visit

http://wiki.codeblocks.org/index.php?title=MinGW_installation

Because a debugger program (toolchain) is very complex undertaking, is not standard in Code::Blocks. You must download it and install on Code::Blocks.

Note: It is impossible copy and paste images here. In the case linked page changes, I, or another one, should suggest new link.

However following are instructions according to images and my experience.

  1. Download TDM-GCC from https://jmeubank.github.io/tdm-gcc/download/ click [tdm64-gcc-10.3.0-2.exe] and run it.

  2. In Wizard Action window - Click [Create].

  3. In Select Edition window - If MinGW/TDM (32-bit) is not checked, check it. Click [Next>].

  4. In Licence Changes window - Click [Next>].

  5. In New Instalation: Instalation Directory window - If text box is "C:\TDM-GCC-32", it's okay. If is not, click [Browse ...], and navigate: C:\ > TDM-GCC-32 > click [OK]. Now text box is C:\TDM-GCC-32. Click [Next>].

If a small window appears saying The directory TDM-GCC-32 is not empty! Are you sure you want to install here?. Click [Yes].

  1. In New Installation: Download Mirror window - Click [Next>].

  2. In New Installation: Choose Components window - Check whether Add to PATH box is checked. Actually is checked. Click [Install].

  3. In Installing window - Wait till [Next] become black. Then click it. Even if Instalation Failed window appears click [Next].

  4. In Completing the TDM-GCC Setup Wizard window - Click [Finish].

  5. Go to Code Blocks > Settings > Compiler.

10a. In Global compiler settings window click "Toolchain executables". Just below, find "Compiler's installation directory". If the below text field is C:\TDM-GCC-32, it's okay. If not, click the [...] at the end of the field. In "Select directory" wizard, navigate to C:\TDM-GCC-32. Now "Folder:" should be TDM-GCC-32. Click [Select a folder] in "Select directory" wizard.

10b. In Global compiler settings. Below red "Note:..." find "Program Files" > "Debuger". If text field reads "GDB/CDB debuger : Default", it's okay, click [OK]. If not, click the down arrow at the end of the field > choose "GDB/CDB debuger : Default". Check that text field is "GDB/CDB debuger : Default". Click [OK].

  1. Go to Code Blocks > Settings > Debugger... . In Common window, left list, click "Default". If "Executable path:"'s text field is "C:\TDM-GCC-32\bin\gdb32.exe", it's okay, click [OK]. If not, click [...] button and navigate C: > TDM-GCC-32 > bin > click gdb32 (or gdb32.exe) file > click [open] in "Select executable file" wizard. "Executable path:" should be C:\TDM-GCC-32\bin\gdb32.exe. Click [OK]. Now you can debug your program.

  2. If Debugger does not function, close Code Blocks and restart them.

Regards.

Upvotes: 1

Anoop M
Anoop M

Reputation: 49

Steps to add gdb.exe Open MinGW Installation Manager select package "mingw32-gdb" from the list. Then select "Apply Changes" in Installation menu. This will automatically install gdb.exe in the path C:\MinGW\bin.

Upvotes: 4

Related Questions