1. 下载安装eclipse cdt 和cygwin
2. 添加$CYGWIN_HOME/bin路径到PATH,保证eclipse可以搜索到cygwin的路径
3.新建c/c++项目,在项目的properties 设置
Go to Project > Properties > C/C++ General > Preprocessor Includes… > Providers and select “CDT GCC Built-in Compiler Settings Cygwin [Shared]”.
下面的配置很重要,不然会导致include的path一直显示linux的路径,但是include的语句一直报错。
ps:
网上一堆的教程,都需要手动设置C_INCLUDE_PATH, CPLUS_INCLUDE_PATH
配置C++11
新版本都已经不需要了。
配置C++11
【更新于2014.06.24(eclipse c++11)】
新安装的Eclipse不能使用C++2011标准,需要手动配置。右击工程,如下图所示:
【更新于2014.06.25:上述设置能解决大部分的c++新特性使用问题,但是中途遇到新问题:
eclipse下c++11数组的begin()和end()操作在不可用,国内各种blog,各种无果,果断在国外网站解决了!方法如下:
- Go to
Project
-> Properties -> C/C++ General -> Path and Symbols -> Tab [Symbols]
.
- Add the symbol : __cplusplus with the value 201103L
- Go to
Project
.
-> Properties -> C/C++ General -> Path and Symbols -> Tab [Symbols] - Add the symbol : __cplusplus with the value 201103L
ref:
另外一个IDE,https://www.cevelop.com/
基于eclipse