News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

Unable to debug C program "No executable specified, use `target exec'."

Started by Curtis_L, May 27, 2023, 02:19:10 PM

Previous topic - Next topic

Curtis_L

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.


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

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


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?

stahta01

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.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

Curtis_L

Quote from: stahta01 on May 27, 2023, 02:21:14 PM
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

Quote from: Curtis_L on May 27, 2023, 02:19:10 PM
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.


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

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


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".