I'm trying to use C++11 but eclipse is having some trouble with it. I've used macports to get gcc48, and I've followed various guides for getting eclipse to use the new compiler, including this, this, and I've also changed the compiler command from the eclipse standard to the g++-mp-4.8 as explained here
I am trying to build the following program:
#include <iostream>
#include<memory>
using namespace std;
int main() {
std::unique_ptr<double> ptr(new double);
*ptr = 11.345;
cout << (*ptr) << endl;
return 0;
}
The terminal will compile this fine,
make all
Building file: ../src/C++11.cpp
Invoking: Cross G++ Compiler
/opt/local/bin/g++ -I/opt/local/bin -I/opt/local/include -O0 -g3 -Wall -c -fmessage-length=0 -std=c++0x -MMD -MP -MF"src/C++11.d" -MT"src/C++11.d" -o "src/C++11.o" "../src/C++11.cpp"
Finished building: ../src/C++11.cpp
Building target: C++11
Invoking: Cross G++ Linker
g++ -o "C++11" ./src/C++11.o
Finished building target: C++11
and the program runs just as expected. However, in eclipse, I still get the error message Symbol 'unique_ptr' could not be resolved
.
I would like to continue using eclipse as more than just a project manager and makefile builder, so any help on this would be appreciated!