Still C++11 problems although I have done all I could found

Hi,

I still egt an Error while compiling code that uses new functions of C++11. The compiler says:

src/ofApp.cpp||In member function ‘virtual void ofApp::setup()’:|
src/ofApp.cpp|17|error: ‘ofRandomMAX_RAND’ was not declared in this scope|
src/ofApp.cpp|18|warning: ‘auto’ changes meaning in C++11; please remove it [-Wc++0x-compat]|
src/ofApp.cpp|18|error: ISO C++ forbids declaration of ‘elem’ with no type [-fpermissive]|
src/ofApp.cpp|18|error: range-based ‘for’ loops are not allowed in C++98 mode|
src/ofApp.cpp|19|error: request for member ‘p’ in ‘elem’, which is of non-class type ‘int’|
src/ofApp.cpp|20|error: request for member ‘p’ in ‘elem’, which is of non-class type ‘int’|
src/ofApp.cpp|21|error: request for member ‘r’ in ‘elem’, which is of non-class type ‘int’|
src/ofApp.cpp||In member function ‘virtual void ofApp::draw()’:|
src/ofApp.cpp|36|warning: ‘auto’ changes meaning in C++11; please remove it [-Wc++0x-compat]|
src/ofApp.cpp|36|error: ISO C++ forbids declaration of ‘elem’ with no type [-fpermissive]|
src/ofApp.cpp|36|error: range-based ‘for’ loops are not allowed in C++98 mode|
src/ofApp.cpp|36|error: ‘circ’ was not declared in this scope|
src/ofApp.cpp|37|error: request for member ‘p’ in ‘elem’, which is of non-class type ‘int’|
src/ofApp.cpp|37|error: request for member ‘p’ in ‘elem’, which is of non-class type ‘int’|
src/ofApp.cpp|37|error: request for member ‘r’ in ‘elem’, which is of non-class type ‘int’|
||=== Build finished: 12 errors, 2 warnings (0 minutes, 4 seconds) ===|

So what I have done is:

CodeBlocks --> Settings --> Compiler --> Compiler Flags --> Have g++ follow C++11 ...

And in the conifg.make file I have included:

# PROJECT_CFLAGS =-std=c++11

And I even have added:

#include <memory>

But it still does not work. But I am able to compile a C++11 file with Codeblocks but not openframeworks.

I am looking forward to hearfrom you. It would be very nice if you could help me.

King regards,

Conny

I often use C++11 with my of apps on a 64bit system and all I do is setting these flags in the config.make

USER_CFLAGS = -std=c++11 -pedantic -O2 -Wno-unused-variable

Just to make sure, you did remove the # in front of your line?

:smiley:
I shouldn’t code when I’m tired :smiley:
You’re right, I have forget to remove “#”.

Thanks for the hint :slight_smile:

King regards
Conny