之前一直学习的是java,所以用eclipse比较多,相比其他软件eclipse更小,对于我而言也更加熟悉。最近需要练习C++编程,我选择了直接在eclipse上使用。
1 首先确认环境里是否安装了command line developer tools
这里参考的文章是这篇:Mac上运行C/C++程序
打开Terminal终端,输入
g++
若提示
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
则需运行
xcode-select --install
安装CommandLineTools;安装成功后,再输入g++提示
clang: error: no input files
2 安装eclipse CDT
这里默认大家已经安装了eclipse,去官网下载,非常简单,也是免费的。有需要的朋友可以点击下方链接安装