Eclipse CDT notes

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).



扫描二维码关注公众号,回复: 3850068 查看本文章

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.

猜你喜欢

转载自blog.csdn.net/juwikuang/article/details/72673027