“No source available for main()” error when debugging simple C++ in Eclipse with gdb

后端 未结 13 1514
醉梦人生
醉梦人生 2020-12-29 04:51

I\'m having trouble debugging a C++ program in Eclipse (the latest RC of Helios, updated with latest CDT from within itself) on OSX.

The program is very simple (esen

13条回答
  •  生来不讨喜
    2020-12-29 05:37

    This thread suggests:

    -g -O0
    

    for debug flags to be set for Eclipse CDT compilation.
    Sometime, it is simple a problem of rebuilding completely the application (like here)

    See also this thread describing a similar situation:

    I have noticed that sometimes in Eclipse I have to go and specifically add the path to my source files using the "add filesystem path" (with "search sub-folders") in the Debug Dialog (even when they are in the same project I am debugging), but I have not noticed a pattern to when I have to do this. But it may be worth a try.

提交回复
热议问题