This is to log
Enable C++11
Step 1. Create a new c++ project.
Write some code using c++ 11. In this case, I use shared_ptr. This is to test if c++ 11 is supported.
#include <iostream>
#include <memory>
using namespace std;
class A
{
};
int main() {
cout << "!!!Hello World!!!" << endl; // prints !!!Hello World!!!
std::shared_ptr<A> a;
return 0;
}Step 2. Change dialogue to c++0x
Go to properties-> Settings ->Tool Settings->Cross GCC Compiler -> Language standard.
Select ISO C++11(-std=c++ox).
Step 3. Rebuild Index
go to menu -> Project -> C/C++ Index -> Rebuild.
Now, it is done. "shared_ptr" should be green. And you will be able to build it.
本文介绍如何在项目中启用C++11标准,并通过使用shared_ptr来验证是否正确配置。步骤包括创建项目、设置编译器标准及重建索引。
1666

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



