wjakob / nanogui

Minimalistic GUI library for OpenGL
Other
4.66k stars 608 forks source link

in addVariable function non-mutable lambda error #250

Closed fatihfurkanaydemir closed 7 years ago

fatihfurkanaydemir commented 7 years ago

under xcode 8.2 c++14 i get this error:

/usr/local/include/nanogui/formhelper.h:183:41: Cannot assign to a variable captured by copy in a non-mutable lambda

in this function:

template <typename Type> detail::FormWidget<Type> *
    addVariable(const std::string &label, Type &value, bool editable = true) {
        return addVariable<Type>(label,
            [&](const Type & v) { value = v; },
            [&]() -> Type { return value; },
            editable
        );
    }
svenevs commented 7 years ago

Is this in code you wrote that is trying to use the FormHelper, or just compiling NanoGUI out-of-the-box? If your code, there is a small error you have somewhere and it doesn't get caught until FormHelper tries to create things for you (?).

If it's just raw NanoGUI, is there any more information in the traceback? What caused the error in the first place?

fatihfurkanaydemir commented 7 years ago

it is trying to use FormHelper.I tried to do same things in the example 3 but i couldn't succed :)

fatihfurkanaydemir commented 7 years ago

Okay indeed i don't need a FormHelper.I succeded to run it now.It is working well thank you.