Important: Please read the Qt Code of Conduct -

Can't build qt5 on win8 with -opengl desktop ?

  • Hi all,

    Trying to build qt5 from source, but it fails to build QtGui for what looks like an inability to load opengl functions. I have the win 8 sdk, using the win32-msvc2012 spec. Latest nvidia drivers. I don't think I'm doing anything wrong - is this just still unsupported at this point? I'd really love to get full opengl support working on windows.

    This is my configure command:
    @configure -nomake demos -nomake examples -c++11 -opengl desktop -saveconfig lastused -nomake webkit -platform win32-msvc2012@

    And here's the compiler error:

    @ cl -c -FIqt_gui_pch.h -Yuqt_gui_pch.h -Fp.obj\debug_shared\Qt5Guid_pch.pch -nologo -Zm200 -Zc:wchar_t -Zi -MDd -W3 -w34100 -w34189 -GR -DUNICODE -DWIN32 -DQT_NO_USING_NAMESPACE -DQT_BUILD_GUI_LIB -DQT_BUILDING_QT -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DQT_USE_QSTRING
    "tmp" -I"image" -I"..\3rdparty\libpng" -I"..\3rdparty\zlib" -I"..\3rdparty\zlib" -I"....\include\QtCore" -I"....\include\QtCore\5.0.0" -I"....\include\QtCore\5.0.0\QtCore" -I".moc\debug_shared" -I"....\mkspecs\win32-msvc2012" -Fo.obj\debug_shared\ @C:\Users\Spencer\AppData\Local\Temp\nm94CD.tmp
    e:\libs\qt-everywhere-opensource-src-5.0.0\qtbase\include\qtgui../../src/gui/opengl/qopenglfunctions.h(593) : error C2039: 'glClearDepth' : is not a member of 'global namespace'' (kernel\qplatformopenglcontext.cpp) e:\libs\qt-everywhere-opensource-src-5.0.0\qtbase\include\qtgui\../../src/gui/opengl/qopenglfunctions.h(593) : error C3861: 'glClearDepth': identifier not found (kernel\qplatformopenglcontext.cpp) e:\libs\qt-everywhere-opensource-src-5.0.0\qtbase\include\qtgui\../../src/gui/opengl/qopenglfunctions.h(715) : error C2039: 'glDepthRange' : is not a member of 'global namespace'' (kernel\qplatformopenglcontext.cpp)
    e:\libs\qt-everywhere-opensource-src-5.0.0\qtbase\include\qtgui../../src/gui/opengl/qopenglfunctions.h(715) : error C3861: 'glDepthRange': identifier not found (kernel\qplatformopenglcontext.cpp)
    e:\libs\qt-everywhere-opensource-src-5.0.0\qtbase\src\gui\opengl\qopenglfunctions.h(593) : error C2039: 'glClearDepth' : is not a member of 'global namespace'' (kernel\qopenglcontext.cpp) e:\libs\qt-everywhere-opensource-src-5.0.0\qtbase\src\gui\opengl\qopenglfunctions.h(593) : error C3861: 'glClearDepth': identifier not found (kernel\qopenglcontext.cpp) e:\libs\qt-everywhere-opensource-src-5.0.0\qtbase\src\gui\opengl\qopenglfunctions.h(715) : error C2039: 'glDepthRange' : is not a member of 'global namespace'' (kernel\qopenglcontext.cpp)
    e:\libs\qt-everywhere-opensource-src-5.0.0\qtbase\src\gui\opengl\qopenglfunctions.h(715) : error C3861: 'glDepthRange': identifier not found (kernel\qopenglcontext.cpp)
    kernel\qopenglcontext.cpp(189) : error C2065: 'GL_PROXY_TEXTURE_2D' : undeclared identifier
    kernel\qopenglcontext.cpp(194) : error C2065: 'GL_TEXTURE_WIDTH' : undeclared identifier
    kernel\qopenglcontext.cpp(194) : error C3861: 'glGetTexLevelParameteriv': identifier not found
    kernel\qopenglcontext.cpp(205) : error C2065: 'GL_TEXTURE_WIDTH' : undeclared identifier
    kernel\qopenglcontext.cpp(205) : error C3861: 'glGetTexLevelParameteriv': identifier not found
    NMAKE : fatal error U1077: 'E:\apps\vs2012\VC\BIN\cl.EXE' : return code '0x2'

  • Moderators


    I managed to compile Qt 5 on Win 8 x64, using MSVC 2012 Express, the latest source from Gitorious, and these flags:

    configure -developer-build -opensource -opengl desktop -nomake examples -nomake tests


    Will it work if you omit -saveconfig lastused' and-platform win32-msvc2012'? (I'm not sure what the former is for; the latter is unnecessary)

    What version of OpenGL does your graphics card support?

    1. Nope. The first just saves my args so I don't have to remember. The second is indeed unnecessary I guess, but it makes no difference if I omit it.
    2. The latest. 4.3 or whatever it is. I have a new Nvidia 660ti

    It seems like I'm missing some sort of opengl header, like glext.h or something. But as far as I can tell the QT build doesn't expect me to have any pre-exising dependencies besides the windows sdk for this.

  • Moderators

    Hmm... hard to tell.

    Some more attempts:

    • Give my configuration a shot (just rename your qtwebkit and qtwebkit-examples-and-demos folders to avoid building them)
    • Do you have Perl and Python installed?

    I'm using an ATI Radeon HD 7770; maybe nVidia's drivers are missing something.

  • Moderators

    I've built it successfully with similar configure options with GTX 570 so it's not nvidia drivers problem.
    -But maybe it's a problem of missing nvidia drivers? Did you install drivers from nvidia site yourself or are you using those defaults provided by windows?- (sorry, I just re-read your first post and see you're using latest drivers)
    Other shot in the dark is that you have something conflicting in your include path like GLUT or GLEW?

  • Well, I just used the qt5 git repository instead of the source archive linked on the download page and now everything works. So, future googlers, use the repo.

    Thanks for the attempts all!

  • Sushisource, I am having the same exact problem as you and can't figure it out. It seems like there are quite a few OpenGL symbols missing (that are normally defined in glew).

    You said you pulled qt5 and it worked? I tried that and it didn't work, so I was wondering if you pulled a specific branch? Any help would be greatly appreciated. Thanks.

  • I pulled the stable branch of qt5 and that seemed to fix it:

    git clone -b stable qt5stable
    perl init-repository --no-webkit

    Open Visual Studio 2010 x64 command prompt:
    configure -release -opensource -shared -opengl desktop -platform win32-msvc2010 -nomake examples -nomake demos -nomake tests
    jom.exe -j 4

    Everything built. I hope that might help others who are having trouble.

Log in to reply