Ubuntu解决eclipse CDT 不能识别C++11 shared_ptr 等特性

解决 eclipse CDT 启动 找不到 jre jdk的解决方法:
在eclipse.ini 文件的开头添加 两行:

-vm
/usr/local/java/jdk-8u131-linux-x64/jre/bin

解决C++ 文件中#include<iostream>报错的问题

C/C++ General -> Paths and Symbols ->Includes -> Add->FileSystem-> /usr/include 

解决C++ 11 新特性不识别的问题
Step 1:
Project->Properties->C/C++ Build->Settings->GCC G++ Compiler->Miscellaneous->Other flags 将-c -fmessage-length=0 改为 -c -fmessage-length=0 -std=c++11

Step 2:

    C/C++ General -> Paths and Symbols -> Symbols -> GNU C++. 点击 "Add..." and 在Name 中添加__GXX_EXPERIMENTAL_CXX0X__  ,"Value" 不设值,点击apply

Step 3
C/C++ General -> Paths and Symbols -> Symbols -> GNU C++. 点击 "Add..." ,Name 写 __cplusplus, value 写 201103L,点击 apply

猜你喜欢

转载自blog.csdn.net/jxhaha/article/details/73061025