首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C++ >

C++ - "Eclipse CDT" (Eclipse C++) 装配 与 配置 (支持C++11)

2013-11-03 
C++ - Eclipse CDT (Eclipse C++) 安装 与 配置 (支持C++11)Eclipse CDT (Eclipse C) 安装 与 配置 (

C++ - "Eclipse CDT" (Eclipse C++) 安装 与 配置 (支持C++11)
"Eclipse CDT" (Eclipse C++) 安装 与 配置 (支持C++11)

 

C++ - "Eclipse CDT" (Eclipse C++) 装配 与 配置 (支持C++11)

 

禁止转载, 如有商业需求请站内联系.

因为VS2012对于C++11的支持不是特别好, 所以可以使用Eclipse CDT, 比较好的支持C++11;

根据本人的经验, 提供一个完整的配置解决方案:

1. Eclipse CDT (C/C++ Development Tooling): 下载地址: http://www.eclipse.org/downloads/

选择: Windows 32 Bit;

C++ - "Eclipse CDT" (Eclipse C++) 装配 与 配置 (支持C++11)

2. MinGW (Minimalist GNU for Windows) : 下载地址: http://sourceforge.net/projects/mingw/?source=dlp

下载, 默认安装即可, 目前(2013.11.2)版本为GCC4.6.2;

3. Eclipse是压缩包形式, 解压即可使用; 需要配置的地方有:

(1). 目录: .\MinGW\bin 中, 把mingw32-make.exe复制为make.exe; 解决: "Program "make" not found in PATH" 问题;

(2). IDE: Project -> Properties -> C/C++ Build -> Settings ->Binary Parsers: 选择: PE Windows Parser; 解决: "Launch failed. Binary not found."问题;

右键"Run as"即可出现, 原因: windows和linux的解析器(Parser)不同, windows需要选择"PE Windows Parser";

(3). IDE: Run -> Run Configurations -> Environment -> New:Name: Path; Value: D\MinGW\bin; (如果你安装在D盘); 解决: "Console无法显示输出" 问题;

(4). IDE: Project -> Properties -> C/C++ Build -> Settings -> Tool Settings ->Cross G++ Complier -> Miscellaneous -> Other flags:

添加: "-c -fmessage-length=0 -std=c++11"; GCC在make时, 添加C++11的特性.

解决: "This file requires compiler and library support for the ISO C++ 2011 standard." 问题, 支持C++11;

C++ - "Eclipse CDT" (Eclipse C++) 装配 与 配置 (支持C++11)

以上问题均为当前版本出现的问题, 截止: 2013-11-01.

4. 常用设置及命令:

(1) Windows -> Preferences -> C/C++ -> Editor->Content Assist: 修改: delay (ms) 为 "1", 则提示速度加快;

(2) "Run as " 快捷键 Ctrl+F11, 不是F11, F11是debug ; 自动补全快捷键: Alt+/ ;

测试:

#include <iostream>#include <array>#include <vector>int main(void) {std::vector<int> iv = {1, 2, 3, 4, 5};for(const auto& i : iv)std::cout << i << " ";std::cout << std::endl;std::cout << "hello world! " << std::endl;}


 

C++ - "Eclipse CDT" (Eclipse C++) 装配 与 配置 (支持C++11)

 

 

热点排行