I use window Eclipse CDT gdb to debug a C++ program. When I wrote may own makefile as follows
all: prog1
prog1: prog1.cpp
g++ -o prog1 prog1.cpp
It compiled and run successfully. But if I click the debug button, it says no available source main....
.
Edit
If I copy the same program to a new C++ project in Eclipse with its internal makefile
(instead of writing my own makefile), I can use debug mode. But eventually, I have the following errors.
No source available for "__mingw_CRTStartup
How should I do?
Thanks.
Try to change your line
g++ -o porg1 prog1.cpp
to
g++ -o prog1 prog1.cpp
Probably the name of the output (ie, the program) is wrong, and therefore Eclipse can't launch it.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.