Are you sure you have provided a function definition for
glDrawArrays
? That is normally a reason why one gets linker errors. Did you qualify the function definition with the class name as in :
1 2 3
|
MyClass::glDrawArrays() {
}
|
Can you show the code, for where this function is called, and the function declaration and definition?
This has probably nothing to do with with your particular problem, but one should always compile with a high level of warnings, at least:
g++ -std=c++14 -Wall -Wextra -pedantic-errors -o executablefilename
If you don't have a compiler that supports c++14, try to get the latest version, or use
-std=c++11
Despite these seemingly comprehensive options, there are even more warning options that come in handy:
http://www.cplusplus.com/forum/general/183731/#msg899203
Warnings are your friend, they help show potential problems with your code. Code may compile without errors, but the warnings point to problems which cause the program to fail at runtime.
If one wants to be super pedantic, then use the option
-Werror , this makes all warnings into errors.
When I am coding, I am not finished until my code is free of all warnings and errors.
It's worth reading the compiler manual if you have time - there are a zillion options:
https://gcc.gnu.org/onlinedocs/
Good luck !!