0

I am trying to define a vector of shared_ptr in my code inside Eclipse Luna CDT. But I am getting compiling error. Any Idea why?

Here is my code:

#include "Object.h"
#include <vector>
#include <memory>

using namespace std;

namespace daemonWorld {

class Holder: public Object {
    int holdWeight = 0;
    int holdValume = 0;
    shared_ptr<Object> test;
    std::vector<shared_ptr<Object>> objects;

In this line I am getting Symbol 'shared_ptr' could not be resolved. Should I include anything more beside memory? g++ options are

D_GXX_EXPERIMENTAL_CXX0X__ -D__Test=1 -D__GXX_EXPERIMENTAL_CXX0X__=1 -I/usr/include/cppunit -O0 -g3 -Wall -c -fmessage-length=0 -std=c++11

The code is running but the eclipse compiler is showing an error.

Govan
  • 2,079
  • 4
  • 31
  • 53
  • 1
    That's a CODAN error, not a compiler error. – user4581301 Oct 14 '15 at 22:49
  • Here's another that may be easier to follow step by step: http://stackoverflow.com/questions/17457069/enabling-c11-in-eclipse-juno-kepler-luna-cdt – user4581301 Oct 14 '15 at 22:50
  • @user4581301 I tested the first link. It is not solving my problem – Govan Oct 14 '15 at 22:57
  • Another option is upgrade to Eclipse Mars. It makes this problem go away, but adopts a slew of new problems. Mind you the last update seems to have fixed most of those. And at the end of the day CODAN isn't perfect. I've got some totally nonsensical errors that I just can't clear out no matter what I do, short of turning CODAN off. – user4581301 Oct 14 '15 at 23:10
  • Thanks the link in third comment helped. I missed the step 7. ove the "GCC Built in Compiler Settings" provider at the top of the list using the 'Move Up' button on the right. – Govan Oct 14 '15 at 23:13

0 Answers0