mac下搭建eclipse java/c++开发环境及gdb安装

1、下载 Eclipse( Java 和 C/C++两个版本)http://www.eclipse.org/downloads/


2、解压缩刚下载下来的两个版本Eclipse,注意不要覆盖了文件名相同的文件,然后将C/C++ 版本的Eclipse 里面的plugins 文件夹中的内容全部复制,粘贴到Java 版本的Eclipse 里面的plugins 文件夹下面


3、创建java和c++工程,Build Project 后运行。
     可能错误:1)运行java程序, eclipse:selection cannot be launched,and there are no recent launches
                          run—>run configuration—>eclipse application—>new ~  新建一个eclipse configuration
                     2)运行c++程序, Launch failed. Binary not found.
                              build all
                             run—>run as location c++ application
                             

4 安装GDB,目前程序可以运行但是无法调试。在Xcode的command line tools里面已经没有gdb,要单独安装。


一:安装brew

terminal 输入命令

 curl -LsSf http://github.com/mxcl/homebrew/tarball/master | sudo tar xvz -C/usr/local --strip 1


二:使用brew安装GDB    
brew install https://raw.github.com/Homebrew/homebrew-dupes/master/gdb.rb   

三:制作证书
过程参考  http://plotcup.com/a/129  

四:配置eclipse,进行debug。

Preferences > C/C++ > Debug > GDB


https://i-blog.csdnimg.cn/blog_migrate/1e8d2f0211beb7550db5356bc674eee7.png


如果你已经创建了一些工程,比如上面的测试程序,可以在Run > Debug Configurations进行修改。


eclipse-gdb-debug



完~


参考链接:
1、 http://www.cnblogs.com/pandy/archive/2013/02/27/2935320.html
2、 http://blog.csdn.net/chenyi8888/article/details/7345113
3、 http://logic0.blog.163.com/blog/static/1889281462014183271283/
4、 http://www.cnblogs.com/yinxiangpei/articles/3897701.html
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值