[Windows] [VS 2015] Qt can't be build with -opengl dynamic or desktop
When giving a -openg dynamic or desktop to Qt, it can't be built on windows and fails with :
link /NOLOGO /DYNAMICBASE /NXCOMPAT /INCREMENTAL:NO /DLL /SUBSYSTEM:WINDOWS /VERSION:5.10 /MANIFEST:embed /OUT:..\..\lib\Qt5OpenGL.dll @C:\Users\MWESTP~1\AppData\Local\Temp\nmF42.tmp
Creating library ..\..\lib\Qt5OpenGL.lib and object ..\..\lib\Qt5OpenGL.exp
qgl.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __cdecl QOpenGLFunctions_1_1::glGetTexLevelParameteriv(unsigned int,int,unsigned int,int *)" (__imp_?glGetTexLevelParameteriv@QOpenGLFunctions_1_1@@QEAAXIHIPEAH@Z) referenced in function "public: void __cdecl QGLContext::drawTexture(class QPointF const &,unsigned int,unsigned int)" (?drawTexture@QGLContext@@QEAAXAEBVQPointF@@II@Z)
qgl.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __cdecl QOpenGLFunctions_1_1::glGetTexImage(unsigned int,int,unsigned int,unsigned int,void *)" (__imp_?glGetTexImage@QOpenGLFunctions_1_1@@QEAAXIHIIPEAX@Z) referenced in function "class QImage __cdecl qt_gl_read_texture(class QSize const &,bool,bool)" (?qt_gl_read_texture@@YA?AVQImage@@AEBVQSize@@_N1@Z)
qgl.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __cdecl QOpenGLFunctions_1_1::glGetDoublev(unsigned int,double *)" (__imp_?glGetDoublev@QOpenGLFunctions_1_1@@QEAAXIPEAN@Z) referenced in function "public: void __cdecl QGLWidget::renderText(double,double,double,class QString const &,class QFont const &)" (?renderText@QGLWidget@@QEAAXNNNAEBVQString@@AEBVQFont@@@Z)
qgl.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __cdecl QOpenGLFunctions_1_1::glDrawBuffer(unsigned int)" (__imp_?glDrawBuffer@QOpenGLFunctions_1_1@@QEAAXI@Z) referenced in function "protected: virtual void __cdecl QGLWidget::glDraw(void)" (?glDraw@QGLWidget@@MEAAXXZ)
qgl.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __cdecl QOpenGLFunctions_1_1::glPushMatrix(void)" (__imp_?glPushMatrix@QOpenGLFunctions_1_1@@QEAAXXZ) referenced in function "void __cdecl qt_save_gl_state(void)" (?qt_save_gl_state@@YAXXZ)
qgl.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __cdecl QOpenGLFunctions_1_1::glPopMatrix(void)" (__imp_?glPopMatrix@QOpenGLFunctions_1_1@@QEAAXXZ) referenced in function "void __cdecl qt_restore_gl_state(void)" (?qt_restore_gl_state@@YAXXZ)
qgl.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __cdecl QOpenGLFunctions_1_1::glMatrixMode(unsigned int)" (__imp_?glMatrixMode@QOpenGLFunctions_1_1@@QEAAXI@Z) referenced in function "void __cdecl qt_restore_gl_state(void)" (?qt_restore_gl_state@@YAXXZ)
qpaintengineex_opengl2.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __cdecl QOpenGLFunctions_1_1::glMatrixMode(unsigned int)" (__imp_?glMatrixMode@QOpenGLFunctions_1_1@@QEAAXI@Z)
qgl.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __cdecl QOpenGLFunctions_1_1::glLoadIdentity(void)" (__imp_?glLoadIdentity@QOpenGLFunctions_1_1@@QEAAXXZ) referenced in function "void __cdecl qt_save_gl_state(void)" (?qt_save_gl_state@@YAXXZ)
qpaintengineex_opengl2.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __cdecl QOpenGLFunctions_1_1::glLoadIdentity(void)" (__imp_?glLoadIdentity@QOpenGLFunctions_1_1@@QEAAXXZ)
qgl.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __cdecl QOpenGLFunctions_1_1::glAlphaFunc(unsigned int,float)" (__imp_?glAlphaFunc@QOpenGLFunctions_1_1@@QEAAXIM@Z) referenced in function "public: void __cdecl QGLWidget::renderText(double,double,double,class QString const &,class QFont const &)" (?renderText@QGLWidget@@QEAAXNNNAEBVQString@@AEBVQFont@@@Z)
qgl.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __cdecl QOpenGLFunctions_1_1::glPushAttrib(unsigned int)" (__imp_?glPushAttrib@QOpenGLFunctions_1_1@@QEAAXI@Z) referenced in function "void __cdecl qt_save_gl_state(void)" (?qt_save_gl_state@@YAXXZ)
qgl.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __cdecl QOpenGLFunctions_1_1::glPopAttrib(void)" (__imp_?glPopAttrib@QOpenGLFunctions_1_1@@QEAAXXZ) referenced in function "void __cdecl qt_restore_gl_state(void)" (?qt_restore_gl_state@@YAXXZ)
qgl.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __cdecl QOpenGLFunctions_1_1::glClearIndex(float)" (__imp_?glClearIndex@QOpenGLFunctions_1_1@@QEAAXM@Z) referenced in function "public: void __cdecl QGLWidget::qglClearColor(class QColor const &)const " (?qglClearColor@QGLWidget@@QEBAXAEBVQColor@@@Z)
qgl.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __cdecl QOpenGLFunctions_1_1::glShadeModel(unsigned int)" (__imp_?glShadeModel@QOpenGLFunctions_1_1@@QEAAXI@Z) referenced in function "void __cdecl qt_save_gl_state(void)" (?qt_save_gl_state@@YAXXZ)
qgl.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __cdecl QOpenGLFunctions_1_1::glIndexi(int)" (__imp_?glIndexi@QOpenGLFunctions_1_1@@QEAAXH@Z) referenced in function "public: void __cdecl QGLWidget::qglColor(class QColor const &)const " (?qglColor@QGLWidget@@QEBAXAEBVQColor@@@Z)
qgl.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __cdecl QOpenGLFunctions_1_1::glColor4f(float,float,float,float)" (__imp_?glColor4f@QOpenGLFunctions_1_1@@QEAAXMMMM@Z) referenced in function "public: void __cdecl QGLWidget::qglColor(class QColor const &)const " (?qglColor@QGLWidget@@QEBAXAEBVQColor@@@Z)
qgl.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __cdecl QOpenGLFunctions_1_1::glPushClientAttrib(unsigned int)" (__imp_?glPushClientAttrib@QOpenGLFunctions_1_1@@QEAAXI@Z) referenced in function "void __cdecl qt_save_gl_state(void)" (?qt_save_gl_state@@YAXXZ)
qgl.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __cdecl QOpenGLFunctions_1_1::glPopClientAttrib(void)" (__imp_?glPopClientAttrib@QOpenGLFunctions_1_1@@QEAAXXZ) referenced in function "void __cdecl qt_restore_gl_state(void)" (?qt_restore_gl_state@@YAXXZ)
qgl.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __cdecl QOpenGLFunctions_1_1::glVertexPointer(int,unsigned int,int,void const *)" (__imp_?glVertexPointer@QOpenGLFunctions_1_1@@QEAAXHIHPEBX@Z) referenced in function "void __cdecl qDrawTextureRect(class QRectF const &,int,int,unsigned int)" (?qDrawTextureRect@@YAXAEBVQRectF@@HHI@Z)
qgl.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __cdecl QOpenGLFunctions_1_1::glTexCoordPointer(int,unsigned int,int,void const *)" (__imp_?glTexCoordPointer@QOpenGLFunctions_1_1@@QEAAXHIHPEBX@Z) referenced in function "void __cdecl qDrawTextureRect(class QRectF const &,int,int,unsigned int)" (?qDrawTextureRect@@YAXAEBVQRectF@@HHI@Z)
qgl.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __cdecl QOpenGLFunctions_1_1::glEnableClientState(unsigned int)" (__imp_?glEnableClientState@QOpenGLFunctions_1_1@@QEAAXI@Z) referenced in function "void __cdecl qDrawTextureRect(class QRectF const &,int,int,unsigned int)" (?qDrawTextureRect@@YAXAEBVQRectF@@HHI@Z)
qgl.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __cdecl QOpenGLFunctions_1_1::glDisableClientState(unsigned int)" (__imp_?glDisableClientState@QOpenGLFunctions_1_1@@QEAAXI@Z) referenced in function "void __cdecl qDrawTextureRect(class QRectF const &,int,int,unsigned int)" (?qDrawTextureRect@@YAXAEBVQRectF@@HHI@Z)
qgl.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) private: static class QOpenGLVersionProfile __cdecl QOpenGLFunctions_1_1::versionProfile(void)" (__imp_?versionProfile@QOpenGLFunctions_1_1@@CA?AVQOpenGLVersionProfile@@XZ) referenced in function "public: void __cdecl QGLContext::drawTexture(class QPointF const &,unsigned int,unsigned int)" (?drawTexture@QGLContext@@QEAAXAEBVQPointF@@II@Z)
qpaintengineex_opengl2.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) private: static class QOpenGLVersionProfile __cdecl QOpenGLFunctions_1_1::versionProfile(void)" (__imp_?versionProfile@QOpenGLFunctions_1_1@@CA?AVQOpenGLVersionProfile@@XZ)
qpaintengineex_opengl2.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __cdecl QOpenGLFunctions_1_1::glOrtho(double,double,double,double,double,double)" (__imp_?glOrtho@QOpenGLFunctions_1_1@@QEAAXNNNNNN@Z) referenced in function "public: virtual void __cdecl QGL2PaintEngineEx::beginNativePainting(void)" (?beginNativePainting@QGL2PaintEngineEx@@UEAAXXZ)
qpaintengineex_opengl2.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __cdecl QOpenGLFunctions_1_1::glLoadMatrixf(float const *)" (__imp_?glLoadMatrixf@QOpenGLFunctions_1_1@@QEAAXPEBM@Z) referenced in function "public: virtual void __cdecl QGL2PaintEngineEx::beginNativePainting(void)" (?beginNativePainting@QGL2PaintEngineEx@@UEAAXXZ)
..\..\lib\Qt5OpenGL.dll : fatal error LNK1120: 24 unresolved externals
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\amd64\link.EXE"' : return code '0x460'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\nmake.exe"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: 'cd' : return code '0x2'
Stop.
NMAKE : fatal error U1077: 'cd' : return code '0x2'
Stop.
NMAKE : fatal error U1077: 'cd' : return code '0x2'
Stop.
CMake Error at C:/pv/sb/pvsb_b/superbuild/sb-qt5-build.cmake:47 (message):
Failed with exit code 2
ninja: build stopped: subcommand failed.
C:\pv\sb\pvsb_b>/projects/qt5.common.cmake
The system cannot find the path specified.
Build fine without any options. Nvidia drivers are installed.
Edited by Mathieu Westphal (Kitware)