I'm trying to compile code w/ shared_ptrs on Raspberry Pi:
#include <iostream>
using namespace std;
int main(int argc, char* argv[]){
shared_ptr<string> message1(new string("Hello Raspberry Pi C++11"));
cout << *message1 <<endl;
return 0;
}
I get the following error:
test.cpp: In function 'int main(int, char**)': test.cpp:4:4: error: 'shared_ptr' was not declared in this scope shared_ptr message1(new string("Hello Raspberry Pi C++11")); ^ test.cpp:4:21: error: expected primary-expression before '>' token shared_ptr message1(new string("Hello Raspberry Pi C++11")); ^ test.cpp:4:70: error: 'message1' was not declared in this scope shared_ptr message1(new string("Hello Raspberry Pi C++11"));
I'm compiling with this command: g++ -std=c++11 -o test test.cpp
G++ version is g++ (Raspbian 4.8.2-21~rpi3rpi1) 4.8.2
Please help.
Aucun commentaire:
Enregistrer un commentaire