Author Topic: Unable to debug C program "No executable specified, use `target exec'."  (Read 9085 times)

Offline Curtis_L

  • Single posting newcomer
  • *
  • Posts: 2
I am new to C and Code::Blocks. I am able to run this Hello World program, but i am unable to use a debugger on it. When I set a break point and try to debug the program, I get the below error message.


Code
#include <stdio.h>
#include <stdlib.h>

int main()
{
    printf("Break Here!\n"); //Break point on this line
    printf("Hello world!\n");
    return 0;
}

Code
Starting debugger: C:\Users\Curtis\mingw64\bin\gdb.exe -nx -fullname -quiet  -args "Q:/Learn-C/1 - Hello World/Hello World/bin/Debug/Hello World.exe"
done
Setting breakpoints
Debugger name and version: GNU gdb (GDB) 11.2
Starting the debuggee failed: No executable specified, use `target exec'

What should I do to get the debugger to work?

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7699
    • My Best Post
Stop using spaces in the path for your project and source files.
Edit: The above is only a guess; but, without more info and experience with debug errors; it is all the help I can give.

Tim S.
« Last Edit: May 27, 2023, 02:30:11 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Curtis_L

  • Single posting newcomer
  • *
  • Posts: 2
Stop using spaces in the path for your project and source files.
Edit: The above is only a guess; but, without more info and experience with debug errors; it is all the help I can give.

Tim S.

This to seems work. I made new project with the same name and it stops at the break point this time.

Gomez22

  • Guest
Re: Unable to debug C program "No executable specified, use `target exec'."
« Reply #3 on: September 20, 2023, 09:02:21 am »
I am new to C and Code::Blocks. I am able to run this Hello World program, but i am unable to use a debugger on it. When I set a break point and try to debug the program, I get the below error message.


Code
#include <stdio.h>
#include <stdlib.h>

int main()
{
    printf("Break Here!\n"); //Break point on this line
    printf("Hello world!\n");
    return 0;
}

Code
Starting debugger: C:\Users\Curtis\mingw64\bin\gdb.exe -nx -fullname -quiet  -args "Q:/Learn-C/1 - Hello World/Hello World/bin/Debug/Hello World.exe"
done
Setting breakpoints
Debugger name and version: GNU gdb (GDB) 11.2
Starting the debuggee failed: No executable specified, use `target exec'

What should I do to get the debugger to work?

Check the debugger's executable path. Go to the "Settings" menu, select "Debugger", and then "GDB/CDB debugger". Ensure that the path to the gdb.exe file is correctly specified. In your case, it should be set to "C:\Users\Curtis\mingw64\bin\gdb.exe".