使用cmake为Eclipse CDT生成的项目

时间:2023-01-24 18:59:14

I followed How to configure a C/C++ project with Eclipse and CMake article to import my project which was generated with cmake to Eclipse CDT. All went fine except when debugging.

我遵循了如何使用Eclipse和CMake配置一个C/ c++项目来将我的项目导入到Eclipse CMake中。除调试外,一切正常。

I get this error when trying to debug

我在尝试调试时得到了这个错误

No source available for "main() at 0x5bca71"

And in gdb console window, here's the message

在gdb控制台窗口,这是消息

The target endianness is set automatically (currently little endian)
No source file named /home/.../Desktop/GP/Test/src/Main.cpp.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

I'm using Eclipse Kepler and cmake version 2.8.10.1 in Linux Mint 15

我在Linux Mint 15中使用Eclipse Kepler和cmake版本2.8.10.1

2 个解决方案

#1


1  

Try setting CMAKE_BUILD_TYPE to Debug and regenerating/rebuilding project.

尝试将CMAKE_BUILD_TYPE设置为Debug和regeneration/ reconstruction项目。

#2


1  

After a whole day of struggling, I switch to Kdevelop4. Importing a cmake project is just as simple as opening the CMakeList.txt file and Kdevelop will do the rest for you. It is so fast, especially its code completion.

经过一整天的挣扎,我换到了kdevelopment 4。导入cmake项目就像打开CMakeList一样简单。txt文件和Kdevelop将为您完成剩下的工作。它非常快,尤其是它的代码完成。

#1


1  

Try setting CMAKE_BUILD_TYPE to Debug and regenerating/rebuilding project.

尝试将CMAKE_BUILD_TYPE设置为Debug和regeneration/ reconstruction项目。

#2


1  

After a whole day of struggling, I switch to Kdevelop4. Importing a cmake project is just as simple as opening the CMakeList.txt file and Kdevelop will do the rest for you. It is so fast, especially its code completion.

经过一整天的挣扎,我换到了kdevelopment 4。导入cmake项目就像打开CMakeList一样简单。txt文件和Kdevelop将为您完成剩下的工作。它非常快,尤其是它的代码完成。