if you get linker-errors with MinGW concerning 'glGetStrig' or 'glGetSring@4' etc., inserting the followinng codeline somewhere in OpenGL initialisation might help:
const GLubyte* dummy = glGetString(1);
Note: 'glGetStrig' is also called by some library-functions. So this error may appear without any 'glGetStrig'-call in your own code.
you're right, this is absolutly strange, but for me it was even more strange, that a library-function which is not called by my program-code, causes linking-problems. For me this meaned that there is something wrong with the inner dependencies of the library.
In fact this is why i found this 'solution': I alway got 'glGetString'-linking-errors at a code where i was sure that it shold work and somehow i figured out, that a call of 'glGenFramebuffer' or 'glBindFramebuffer' causes them. This was so strange, that i wanted to find out, what happens if i call 'glGetString' directly. And - uups - suddenly also the 'gl...Framebuffer'-call was compiled correctly.
I don't know why, but i had this problem in two programs now and both times it worked.
Maybe it has to do something with compiler-heuristics, like this: in some cases with MinGW an object, need an expicit destructor in the .c file to be linkable. A destructor-function in the object-protoype (something like "~Name() {..};") leads to 'undefined reference to'-errors. With any other function (incuding the constructor) this causes no problem. So obviously the compiler needs the destuctor as 'hook' for the linking-table-entry. This might be some simelar thing...
It sounds like as if you provide multiple conflicting [version] librarys. When you add that particular line the linker accidentally chooses the right one. If so this behavior might even change the next time you change your code.
There you migth be right. I'm not good in setting up c-compilers and the result is more accidetially then planned. But this is the second independent compiler-setup, where this appers. So i obviously installed accidentially two tlimes the same incompatible librarys.
In fact - which is quiet funny - yesterday i had this problem and it was my own forgotton post from 2014 (http://www.cplusplus.com/forum/general/142808/) i found on google, which helped me this time.
So i thought, it will be good to make a second post for other people.
By the way: also if libraries don't fit, this behaviour is quiet strange, isn't it??