A short c++ file and makefile: I can make in the shell, but get lots of error while building it in the Eclipse

I'm compiling a very short c++ file using makefile.The c++ file using a external libary named ClanLib, but that's not the point, because I can use "make" command to compile it in the shell, so the c++ file and the makefile are OK.

#include <ClanLib/core.h>
#include <ClanLib/application.h>

class ConsoleProgram {
public:
    static int main(const std::vector<CL_String> &args);
};
CL_ClanApplication app(&ConsoleProgram::main);
int ConsoleProgram::main(const std::vector<CL_String> &args) {
    CL_SetupCore setup_core;
    CL_ConsoleWindow console_window("Console");
    CL_Console::write_line("Hello World!");
    CL_Console::wait_for_key();
    return 0;
}




BIN     = main
OBJF    = main.o
LIBS    = clanCore  clanDisplay  clanGL  clanGL1  clanApp clanSWRender
VERSION = 2.3

PACKAGES = $(patsubst %, %-$(VERSION), $(LIBS))
INCLUDE += -I/usr/include/ClanLib-2.3/ 
CXXFLAGS += $(INCLUDE) `pkg-config --cflags $(PACKAGES)` -pthread

all: $(BIN)

$(BIN): $(OBJF)
    $(CXX) $(CXXFLAGS) $(OBJF) -o $(BIN) `pkg-config --libs $(PACKAGES)`

clean:
    find . -name '*.o' -type f -print -exec rm -rf {} \;
    rm -f $(BIN)

%.o : %.cpp
    $(CXX) $(CXXFLAGS) -c $< -o $@

%.o : %.hpp
    $(CXX) $(CXXFLAGS) -c $< -o $@

But I get lots of errors while compiling it in the eclipse, I've been googling from morning but without any clues.

/usr/include/ClanLib-2.3/ClanLib/Core/Crypto/aes128_decrypt.h:116:2: error: ‘shared_ptr’ in namespace ‘std’ does not name a type
In file included from /usr/include/ClanLib-2.3/ClanLib/core.h:217:0,
                 from main.cpp:1:
/usr/include/ClanLib-2.3/ClanLib/Core/Crypto/aes192_encrypt.h:114:2: error: ‘shared_ptr’ in namespace ‘std’ does not name a type
In file included from /usr/include/ClanLib-2.3/ClanLib/core.h:218:0,
                 from main.cpp:1:
/usr/include/ClanLib-2.3/ClanLib/Core/Crypto/aes192_decrypt.h:116:2: error: ‘shared_ptr’ in namespace ‘std’ does not name a type
In file included from /usr/include/ClanLib-2.3/ClanLib/core.h:219:0,
                 from main.cpp:1:
/usr/include/ClanLib-2.3/ClanLib/Core/Crypto/aes256_encrypt.h:114:2: error: ‘shared_ptr’ in namespace ‘std’ does not name a type
In file included from /usr/include/ClanLib-2.3/ClanLib/core.h:220:0,
                 from main.cpp:1:
/usr/include/ClanLib-2.3/ClanLib/Core/Crypto/aes256_decrypt.h:116:2: error: ‘shared_ptr’ in namespace ‘std’ does not name a type
make: *** [main.o] Error 1

Any clue or advise will be very appreciated.

I'm useing Fedora 17 x86_64, eclipse indigo.

Answers


You need to add std=c++0x to the g++ compiler flags to get std::shared_ptr.


Need Your Help

How to make smooth rotation of image?

iphone ipad uigesturerecognizer image-rotation

Currently i am using UIRotationGestureRecognizer to rotate my image and my image currently rotating smoothly.

How can I trigger a jQuery alert when an iframe AND its CSS is loaded and rendered?

jquery css iframe tinymce

I'm trying to trigger an alert when an &lt;iframe&gt; and its CSS files are loaded and rendered.

Display selected picture under it's button with multiple buttons

javascript jquery html5 css3

Sorry the title is not better. Here is where I'm at. I am trying to open an openFileDialog, then display the image I picked below that button. I can do it fine with one button and one image. Howeve...

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.