Eclipse CDT 导入 Makefile 构建的 C/C++ 工程

Eclipse CDT 导入 Makefile 构建的 C/C++ 工程

  • 作者:柳大·Poechant(钟超)
  • 邮箱:zhongchao.ustc#gmail.com(# -> @)
  • 博客:Blog.CSDN.net/Poechant
  • 日期:June 30th, 2012

我是在 Mac OS X 上使用的 Eclipse CDT,Linux 和 Windows 版本的也相类似,一般只是 Preference 的位置不同。

  1. File -> New -> Makefile Project with Existing Code
  2. 选择源码目录,语言选择C语言。如果是 Linux 环境,则选中 Linux GCC,Mac 环境则选择 MacOSX GCC,Windows 下用 Eclipse 则可以选择 MinGW GCC。
  3. Project -> Make Target -> Create,建立 all 和 clean 两个 Targets。
  4. 在 Make Target 的 View 里面选择刚刚建立的项目的 all 来构建项目
  5. 构建结束后,Run -> Debug As -> Local C/C++ Application -> gdb/mi,调试选项可以在 Debug Configuration 中设置。

其中 gdb/mi 和 gdb 的区别,在网上搜来如下解释:

gdb and gdb/mi are essentially the same, except that gdb/mi lets you
select the MI protocol version and command set to use (MI - or Machine 
Interface - is how Eclipse communicates with gdb, rather than using 
the normal gdb command-line interface). This is useful if you want to 
do something not supported by the defaults, or have a non-standard gdb,
such as used on Mac OS X. gdbserver is a very lightweight debug server
used for debugging embedded systems. **The normal gdb/mi commands are 
used, but gdb must be told to connect to a gdbserver running on a remote 
system.** There's an extra tab for specifying this information.

Reference:

  1. http://dev.eclipse.org/mhonarc/lists/photran/msg00926.html
  2. http://blog.csdn.net/kevin_zqw/article/details/6927151



-

七海互联团队 Club APP 官网:http://whatsclub.cn (Club APP,年轻人的兴趣俱乐部/社区)

-

转载请注明来自柳大的CSDN(钟超):Blog.CSDN.net/Poechant

-

-

七海互联团队 Club APP 官网:http://whatsclub.cn (Club APP,年轻人的兴趣俱乐部/社区)

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

钟超

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值