Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse Mars: Symbol 'unique_ptr' could not be resolved

Tags:

c++

c++11

eclipse

Using Eclipse Mars, I am getting the Symbol 'unique_ptr' could not be resolved error. I tried adding -std=c++11 to CDT GCC Built-in Compiler Settings, but this didn't help. The error goes away when I reopen Eclipse, but if I make a modification to the code, the error comes back.

One simple code sample:

std::unique_ptr<String> p1;
like image 885
Robbie Tacescu Avatar asked Nov 12 '15 08:11

Robbie Tacescu


1 Answers

  1. In Eclipse Mars open Window > Preferences > C/C++ > Build > Settings > Discovery > CDT GCC Build-in Compiler Settings
  2. Append -std=c++11 to the Command to get compiler specs
  3. Press OK
  4. Rebuild the index: Project > C/C++ Index > Rebuild
like image 169
Matthias Avatar answered Sep 24 '22 14:09

Matthias