Results 1 to 4 of 4

Thread: Gotcha warning - Qt5 source build on Windows with Visual Studio

  1. #1
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Gotcha warning - Qt5 source build on Windows with Visual Studio

    Qt 5 is now officially released, but binaries are not available for Visual Studio 2008. Therefore, you must build it from source.

    There are several "gotchas" to beware of:

    1 - If you download the source rather than clone the git repository, you must download the ZIP file version, not the tar.gz version. The ZIP version contains a file that is required for bootstrapping the configuration, and this file is missing from the tarball. If you don't have this file, the config fails. So, download the ZIP distribution.

    2 - You must have both perl and python installed. The configure script depends on them. Be sure both are installed and in your $path. See the README file in the toplevel directory of the distribution for version details.

    3 - If you are building libraries for desktop use, the configure command given in the README file will not work, because it defaults to OpenGL/ES, which is not installed on Windows desktops by default. So use this configure command instead (from a Visual Studio 2008 command window - in VS, find it on the Tools menu):

    Qt Code:
    1. configure -prefix %CD%\qtbase -opensource -opengl desktop -nomake tests
    To copy to clipboard, switch view to plain text mode 

    4 - Once the configuration script is done, build the sources:

    Qt Code:
    1. nmake
    To copy to clipboard, switch view to plain text mode 

    Then go and have lunch, and maybe it will be done by the time you get back.

    I wasted half a day before finally figuring all this out.

  2. #2
    Join Date
    Sep 2007
    Posts
    4
    Thanks
    2

    Default Re: Gotcha warning - Qt5 source build on Windows with Visual Studio

    I'd like to add something. After the build process finishes, you'll also need to build the Qt docs. Type
    Qt Code:
    1. nmake docs
    To copy to clipboard, switch view to plain text mode 
    and wait until it finishes.

  3. #3
    Join Date
    Oct 2012
    Location
    The land of pain (NY)
    Posts
    99
    Thanks
    7
    Thanked 3 Times in 2 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Windows Android

    Default Re: Gotcha warning - Qt5 source build on Windows with Visual Studio

    Quote Originally Posted by d_stranz View Post
    Qt 5 is now officially released, but binaries are not available for Visual Studio 2008. Therefore, you must build it from source.

    There are several "gotchas" to beware of:

    1 - If you download the source rather than clone the git repository, you must download the ZIP file version, not the tar.gz version. The ZIP version contains a file that is required for bootstrapping the configuration, and this file is missing from the tarball. If you don't have this file, the config fails. So, download the ZIP distribution.

    2 - You must have both perl and python installed. The configure script depends on them. Be sure both are installed and in your $path. See the README file in the toplevel directory of the distribution for version details.

    3 - If you are building libraries for desktop use, the configure command given in the README file will not work, because it defaults to OpenGL/ES, which is not installed on Windows desktops by default. So use this configure command instead (from a Visual Studio 2008 command window - in VS, find it on the Tools menu):

    Qt Code:
    1. configure -prefix %CD%\qtbase -opensource -opengl desktop -nomake tests
    To copy to clipboard, switch view to plain text mode 

    4 - Once the configuration script is done, build the sources:

    Qt Code:
    1. nmake
    To copy to clipboard, switch view to plain text mode 

    Then go and have lunch, and maybe it will be done by the time you get back.

    I wasted half a day before finally figuring all this out.
    From the Qt for Windows Requirements It states that "Install Python from here and add the installation location to your PATH in order to be able to build QtJsBackend and QtWebKit." If you're not building those features, I wonder if you can defer installing Python.

  4. #4
    Join Date
    Nov 2014
    Posts
    1
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Unhappy Re: Gotcha warning - Qt5 source build on Windows with Visual Studio

    It does not work! Several QT dll are really built, but compilation hangs.

    cl -c -FIqt_gui_pch.h -Yuqt_gui_pch.h -Fp.pch\debug\Qt5Guid_pch.pch -nologo -Zm200 -Zc:wchar_t -arch:SSE2 -Zi -MDd -GR -W3 -w34100 -w34189 /Fd..\..\lib\
    Qt5Guid.pdb -DUNICODE -DWIN32 -DQT_NO_USING_NAMESPACE -DQT_BUILD_GUI_LIB -DQT_BUILDING_QT -D_CRT_SECURE_NO_WARNINGS -D_USE_MATH_DEFINES -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER -DQT_DEPRECATED_WARNINGS -DQT_DISABLE_DEPRECATED_BEFORE=0x040800 -DQT_USE_BUNDLED_LIBPNG -DQT_OPENGL_ES_2 -DQT_OPENGL_ES_2_ANGLE -DQT_NO_EXCEPTIONS -DQT_CORE_LIB -I"..\..\include" -I"..\..\include\QtGui" -I"..\..\include\QtANGLE" -I"..\..\include\QtGui\5.3.2" -I"..\..\include\QtGui\5.3.2\QtGui" -I"tmp" -I"image" -I"..\3rdparty\libpng"
    -I"..\3rdparty\zlib" -I"..\3rdparty\zlib" -I"..\..\include\QtCore\5.3.2" -I"..\..\include\QtCore\5.3.2\QtCore" -I"..\..\include\QtCore" -I".moc\debug" -I"..\..\mkspecs\win32-svc2008" -Fo.obj\debug\ @C:\DOCUME~1\FOJTIK~1.ESC\LOCALS~1\Temp\n
    m131F.tmp
    qopenglcontext.cpp
    kernel\qopenglcontext.cpp(368) : error C2065: 'GL_PROXY_TEXTURE_2D' : undeclared identifier
    kernel\qopenglcontext.cpp(373) : error C2065: 'QOpenGLFunctions_1_0' : undeclared identifier
    kernel\qopenglcontext.cpp(373) : error C2065: 'gl1funcs' : undeclared identifier
    kernel\qopenglcontext.cpp(373) : error C2065: 'QOpenGLFunctions_1_0' : undeclared identifier
    kernel\qopenglcontext.cpp(374) : error C2065: 'gl1funcs' : undeclared identifier
    kernel\qopenglcontext.cpp(374) : error C2227: left of '->initializeOpenGLFunctions' must point to class/struct/union/generic type
    type is ''unknown-type''
    kernel\qopenglcontext.cpp(375) : error C2065: 'gl1funcs' : undeclared identifier
    kernel\qopenglcontext.cpp(375) : error C2227: left of '->glGetTexLevelParameteriv' must point to class/struct/union/generic type
    type is ''unknown-type''
    kernel\qopenglcontext.cpp(375) : error C2065: 'GL_TEXTURE_WIDTH' : undeclared identifier
    kernel\qopenglcontext.cpp(386) : error C2065: 'gl1funcs' : undeclared identifier
    kernel\qopenglcontext.cpp(386) : error C2227: left of '->glGetTexLevelParameteriv' must point to class/struct/union/generic type
    type is ''unknown-type''
    kernel\qopenglcontext.cpp(386) : error C2065: 'GL_TEXTURE_WIDTH' : undeclared identifier
    NMAKE : fatal error U1077: '"D:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.EXE"' : return code '0x2'
    Stop.
    NMAKE : fatal error U1077: '"D:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\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.

Similar Threads

  1. dont step into Qt source - Visual Studio
    By tuli in forum Installation and Deployment
    Replies: 3
    Last Post: 8th December 2012, 15:41
  2. Can't build qwt with visual studio
    By Patrik in forum Qwt
    Replies: 10
    Last Post: 14th April 2011, 00:56
  3. How to Qt4.7 Source with Visual Studio 2010
    By Aenima1981 in forum Installation and Deployment
    Replies: 0
    Last Post: 1st October 2010, 14:00
  4. qt visual studio add-in source code
    By GreenScape in forum General Programming
    Replies: 2
    Last Post: 3rd August 2010, 11:50
  5. Replies: 17
    Last Post: 3rd July 2008, 00:48

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.