eclipse调试linux项目,linux下使用Eclipse编译调试C++ makefile项目

从网上下到的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:$PATH

export 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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值