shaderview icon indicating copy to clipboard operation
shaderview copied to clipboard

Compilation errors due to C++11

Open mattrei opened this issue 10 years ago • 2 comments

Hi Joseph,

I get the following compilation error below. Using g++ version 4.9. Tried to activate c++11 features however then the other addons won't compile.

Can you give some instructions with what flags you compile this plugin?

Thanks, Matthias

src/ofApp.cpp:129:21: error: ISO C++ forbids declaration of ‘it1’ with no type [-fpermissive]
     for(auto const &it1 : uniforms) {
                     ^
src/ofApp.cpp:129:27: error: range-based ‘for’ loops are not allowed in C++98 mode
     for(auto const &it1 : uniforms) {
                           ^
src/ofApp.cpp:130:33: error: request for member ‘first’ in ‘it1’, which is of non-class type ‘const int’
         shader.setUniform1f(it1.first, uniforms[it1.first]);
                                 ^
src/ofApp.cpp:130:53: error: request for member ‘first’ in ‘it1’, which is of non-class type ‘const int’
         shader.setUniform1f(it1.first, uniforms[it1.first]);
                                                     ^

mattrei avatar Aug 05 '15 11:08 mattrei

Hmm.... Let me see I can fix that. I build everything through xcode at the moment so it does all the flag magic.

josephwilk avatar Aug 09 '15 12:08 josephwilk

Sweet. If I add the c++11 flag it tries also to compile the oF plugins with the new standard and that produces a bunch of other errors. However (for such and similar reasons) my knowledge of c++ is quite limited.

mattrei avatar Aug 10 '15 08:08 mattrei