Code::Blocks Forums

User forums => Help => Topic started by: Curtis_L on May 27, 2023, 02:19:10 pm

Title: Unable to debug C program "No executable specified, use `target exec'."
Post by: 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.


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?
Title: Re: Unable to debug C program "No executable specified, use `target exec'."
Post by: 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.
Title: Re: Unable to debug C program "No executable specified, use `target exec'."
Post by: Curtis_L on May 27, 2023, 02:40:06 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.
Title: Re: Unable to debug C program "No executable specified, use `target exec'."
Post by: Gomez22 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".