1、下载 Eclipse( Java 和 C/C++两个版本)http://www.eclipse.org/downloads/
2、解压缩刚下载下来的两个版本Eclipse,注意不要覆盖了文件名相同的文件,然后将C/C++ 版本的Eclipse 里面的plugins 文件夹中的内容全部复制,粘贴到Java 版本的Eclipse 里面的plugins 文件夹下面。
可能错误: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
如果你已经创建了一些工程,比如上面的测试程序,可以在Run > Debug Configurations进行修改。
完~
参考链接:
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