this is in response to the “How do I use c++11 in codeblocks?” http://forum.openframeworks.cc/t/how-do-i-use-c++11-in-codeblocks/13244/0 thread started by JLafarga. It is not my intention to be disrespectful to him/her or arturo but what arturo recommended in that thread doesn’t really work, just try it and you’ll see, so Im asking again what is the right way to do it? I myself am a newbie to codeblocks and linux. This are the errors thrown by codeblocks in case you don’t feel like clicking the linked thread:
-------------- Build: Debug in emptyExample ---------------
Using makefile: Makefile
Compiling OF library for Debug
Done!
Compiling emptyExample for Debug
Compiling src/main.cpp
In file included from …/…/…/libs/openFrameworks/utils/ofLog.h:5:0,
from …/…/…/libs/openFrameworks/ofMain.h:7,
from src/main.cpp:1:
…/…/…/libs/openFrameworks/types/ofTypes.h:13:18: error: shared_ptr is already declared in this scope
…/…/…/libs/openFrameworks/types/ofTypes.h:14:18: error: weak_ptr is already declared in this scope
…/…/…/libs/openFrameworks/types/ofTypes.h:15:18: error: enable_shared_from_this is already declared in this scope
make[1]: *** [obj/linux64/Debug/src/main.o] Error 1
make: *** [Debug] Error 2
Process terminated with status 2 (0 minutes, 4 seconds)
3 errors, 0 warnings
edit: arturo’s tip was to add “-std=c++0x” or “-std=gnu++0x” flags to the line that says “PROJECT_CFLAGS =” in the config.make file in the projects folder. Add them and any normal project (by normal I just mean any project that doesn’t use any fancy new c++11 stuff like the STL containers i.e. maps, arrays, lists and what not) and that project wont compile, remove the flag and everything is ok.