tar zxvf eclipse-cpp-photon-R-linux-gtk-x86_64.tar.gz
#ln -s /usr/local/eclipse/eclipse /usr/bin/eclipse
vi /usr/share/applications/eclipse.desktop
添加以下信息:
[Desktop Entry]
Version=1.0
Type=Application
Name=Ecipse
Comment=Eclipse SimRe
Exec=/usr/local/eclipse/eclipse
Icon=/usr/local/eclipse/icon.xpm
Terminal=false
X-MultipleArgs=false
Categories=Development;Java;IDE
StartupNotify=true
Encoding=UTF-8
汉化:
http://www.eclipse.org/babel/downloads.php
下载相应的语言包BabelLanguagePack-eclipse-zh*,然后解压到 eclipse根目录下。
升级gtk
yum update gtk2-devel -y
eclipse 开启多核编译:
Properties->C/C++ Build->Behavior->Build settings->enable parallel build复选项打钩。
eclipse支持c++17 在CDT设置如下:
0、Window -> Preferences -> C/C++ -> Build -> Settings -> Discovery -> CDT GCC Build-in Compiler Settings
添加-std=c++17
1、Properties -> C/C++ Build -> Settings -> Tool Settings -> GCC C++ Compiler -> Dialect
选择空白项并且添加 -std=c++17 到other dialect flags
如果是CMake项目:cmake -G"Eclipse CDT4 - Unix Makefiles" -D CMAKE_BUILD_TYPE=Debug ..
2、Properties -> C/C++ Build -> Settings -> Tool Settings -> GCC C++ Compiler -> Miscellaneous
添加 "-std=c++17" ,不要引号。
3、Properties -> C/C++ General -> Preprocessor Include Paths, Marcos etc. -> Providers
在Command to get Compiler spes 的值的后面加上"-std=c++17" 不要引号
菜单里面选择 Project ->C/C++ Index 重建索引使c++ 17的代码提示正确。
编译的时候,由于C++不同版本的方法不同,导致一个正确的语句无法编译过去,提示错误就是函数变量类型不符合。
点击头文件查看后发现,C++头文件判断了文件版本,即通过:
#if __cplusplus >= 201103L
第一步:
Project->Properties->C++ General->Pahts and Symbols->Symbols(选项卡)
增加 __cplusplus Symbol 然后设置值为201103L (注意,这里的cplusplus前面时两条横线)
第二步:Project->Properties->C/C++ Build > Settings > GCC C++ Compiler > Miscellaneous > other flages ,在原来的基础上添加上 "-std=c++11"
Eclipse CDT配置指南
本文详细介绍如何在Linux环境下配置Eclipse CDT进行C/C++开发,包括安装、汉化、支持多核编译及C++17特性等步骤,并解决特定编译问题。
1026

被折叠的 条评论
为什么被折叠?



