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

后端 未结 13 1521
醉梦人生
醉梦人生 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:33

    Seems like this message can have plenty of reasons to show.

    For me (in the context of micro controller debugging) it was the link-time optimization. With -flto it broke; removing -flto from the "Other Options" field fixed this for me.

    In Eclipse Neon (4.6) see Project -> Properties -> C/C++ Build -> Settings -> Tool Settings -> C Compiler -> Miscellaneous -> Other options.

提交回复
热议问题