Not directly applicable to OP's problem, but I had an error with the same message where I was trying to push to a vector class member from inside a method marked as const. Neither the vector type nor the data I was passing to it had the const modified, which made it very confusing for me. Removing the const
modifier from the function fixed the problem for me. (e.g. int MyClass::myFunc() const
-> int MyClass::myFunc()
)