开发者

Eclipse CDT C++ error

开发者 https://www.devze.com 2023-02-15 14:04 出处:网络
I use window Eclipse CDT gdb to debug a C++ program. When I wrote may own makefile as follows all: prog1

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 (i.e., the program) is wrong, and therefore Eclipse can't launch it.

0

精彩评论

暂无评论...
验证码 换一张
取 消