[C++] Solve "No source available for main()" error when debugging on Eclipse

In Mac,

the issue image:

1. A existing cmake project on disk

2. import this project into Eclipse.

3 run cmake

cmake "Unix Makefile" .

4. Build and Run this project on Eclipse successfully 

5. After clicking Debug button on Eclipse, the following error appears:

"No source available for main()"

 

Solution:

At step 3, use the below command:

cmake . -DCMAKE_BUILD_TYPE=Debug

Then, the Eclipse debugging should work.

 

Reference:

"No source available for main()" while debugging in Eclipse IDE, ros.org

 

posted @ 2017-03-30 08:02  TonyYPZhang  阅读(1181)  评论(0编辑  收藏  举报