User forums > Help

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

(1/1)

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.



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

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

--- End code ---


--- 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'
--- End code ---

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.

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.

--- End quote ---

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.



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

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

--- End code ---


--- 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'
--- End code ---

What should I do to get the debugger to work?

--- End quote ---

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

Navigation

[0] Message Index

Go to full version