Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Qt5 opengl linker errors, and how to debug linking command line in Qt Creator
Hi, I have a couple of questions related to a linker problem...
I have a fairly large Qt project using OpenGL which compiles nicely under Qt4. When changing to 5.0.1 I get lots of linker errors related to OpenGL: "unresolved external symbol _imp_glEnd@0" and similar. I am quite certain that I have included the Qt OpenGL module, i.e.
QT += opengl
So it seems that something is overriding the linker statement somehow. And this leads me to my next question. In Qt Creator all the linker arguments seem to be packed into a .jom file that is deleted afterwards. Is there some way to output the actual linker command arguments to the console so I can see which libraries are actually linked in?
Any help would be greatly appreciated
Is you Qt 5 build for OpenGL ES ? In that case and IIRC the fixed pipeline functions are not available. You will need to rebuild Qt with Desktop OpenGL to have them or port your code to use the programmable pipeline.
Hope it helps
Hi and thanks for the suggestion. That could of course be it, but I use the default Windows Qt5 distribution, with the "Desktop Qt5.0.1 MSVC2010 32 bit" kit, so I'd think that it was Desktop OpenGL? I also get linker errors on all wgl and glu-methods.
I am not sure right now, but i think the default is OpenGL ES/Angle for windows. You'd better double check that
It appears that you are right, OpenGL ES only on windows. That sucks, because I have a ton of legacy code using fixed pipeline... Oh well, I guess I can compile Qt from source, or roll up my sleeves and start a huge rewrite of old code...
Any ideas on how to show the contents of the linker command line?
I think you can do both: recompile Qt to have access to an OpenGL profile that allows the fixed pipeline and when you're done with that, use a profile that provides both/only the programmable pipeline to update your code base.
IIRC you have to read the console to see that, but the Makefiles should provide you with some hints