linux下使用Eclipse编译调试C++ makefile项目
来源:互联网 发布:h3c添加端口到vlan 编辑:程序博客网 时间:2024/06/04 17:56
从网上下到的C++源码基本上都是带makefile的project。对于此类project我们可以使用eclipse进行编译和调试
1)下载安装eclipse C++
sudo apt-get install eclipse eclipse-cdt g++
2)git clone 源码
3)ecplipse导入源码
file->new->c++->打开一个makefile工程
4)./configure出makefile
以我参与的数据库项目peloton为例
Run bootstrap
./bootstrap
Go the build directory and run configure
cd build../configure CXXFLAGS="-g -ggdb -O0" --enable-debug
Build and install Peloton
make -j4 sudo make -j4 install
Update paths
export PATH=/usr/local/peloton/bin:$PATHexport LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
大的project因为涉及到库之类的,所以先安装一遍
5)在eclipse左边资源管理器中的build文件夹下找到makefile文件,右键->make target->create->-j4
这样就相当于make -j4
也可以all,相当于make all
我的项目里还用到:
V=1
check -j4
6)在eclipse左边资源管理器中右键,选择Debug,列表中选择你想debug的可执行文件,本例中为peloton
如果没有virtual binareis就找不到可执行文件,要设置一下:
Project->Properties->C/C++ Build->Settings->Binary Parsers, In Linux I use Elf parser.
如果是windows:
PE Windows Parser (or you can select Cygwin if you use that compiler).
7)在eclipse左边资源管理器中右键,选择Debug Configuration
在参数中输入 peloton对应的参数:-D /home/michael/peloton/build/data
到此为止,配置完毕可以debug了
8)遇到的问题
有时可能遇到库文件找不到的错误,用下面方法解决
ldconfig /usr/local/cuda/lib
参考阅读:
http://blog.csdn.net/linuxarmsummary/article/details/41596579
- linux下使用Eclipse编译调试C++ makefile项目
- [Linux]在ubuntu系统下编译运行c程序并使用makefile管理项目
- Ubuntu下eclipse编译调试带makefile的c++项目源码
- Linux下C多文件编译Makefile
- eclipse 下使用MDK编辑、编译、调试
- Linux C Makefile编译
- eclipse 远程调试linux下 tomcat 项目
- eclipse远程调试linux下的项目
- Linux使用eclipse编译,调试Nginx模块
- Linux使用eclipse编译,调试Nginx模块
- Linux 下 C程序编译与调试
- linux 下c 编译和调试
- linux 下c 编译和调试
- linux 下c 编译和调试
- 关于linux下执行脚本编译C++:需要使用make命令和makefile
- eclipse 灵活使用makefile来编译C/C++
- 在Linux中使用VS Code编译调试C++项目(gcc/g++、Makefile入门、vs code)
- Ubuntu下使用Eclipse IDE for C/C++ Developers交叉编译和调试
- 学习Python (九)
- 使用泛型实现单例模式提供者
- 解决网页百度转码的问题
- 黑马程序员_接口interface
- 易语言5.4一键破解工具
- linux下使用Eclipse编译调试C++ makefile项目
- [LeetCode212] Word Search II
- 80端口被NT kernel占用
- MySQL数据库基准压力测试工具之MySQLSlap使用实例
- 6.1 顶点和输入布局
- AWR基本操作
- HDU1269 迷宫城堡(裸强连通分量)
- IOS常用第三方框架
- ViewPager_navigation_tz