Qt 5.1.0 static build from source will not compile properly



  • Okay so, I have tried many many many different guides on building Qt from source. A little background: I run Windows 7 on a x64 computer. I am attempting to build static Qt in 64 bit's to allow me to create a static 64 bit compilation of an application I have developed. The problem appears to lay in the actual make.

    My steps:

    1. I created a new folder in which I extract the qt-everywhere zip file ( ...\Qt5.1.0_static)
      2) I downloaded and installed : Perl64, Python27, the DirectX SDK, MinGW64
      3) I created a build folder (...\Qt5.1.0_static\5.1.0-qt-64x-build)
      4) I ran from the build folder :
      @set QMAKESPEC=win32-g++
      set LANG=en
      set QTDIR=
      set PATH=C:\Perl64\bin;C:\Python27;C:\Qt\Qt5.1.0_static\mingw64_x64\bin;C:\Windows\System32
      C:\Qt\Qt5.1.0_static\configure -platform win32-g++ -release -static -developer-build -c++11 -nomake tests -nomake demos -nomake examples -no-openvg -no-opengl -no-vcproj -opensource -confirm-license@

    Up until this point its all dandy, until I run:

    1. @mingw32-make -j8 > results.txt 2>&1@

    Here are the log files of the end of the compilation ->

    @mingw32-make[4]: *** [.obj/release_static/qoffscreensurface.o] Error 1
    In file included from C:\Qt\Qt5.1.0_static\qtbase\include/QtGui/qopengl.h:1:0,
    from C:\Qt\Qt5.1.0_static\qtbase\include\QtGui\5.1.0\QtGui/qpa/../../../../../src/gui/kernel/qplatformopenglcontext.h:60,
    from C:\Qt\Qt5.1.0_static\qtbase\include\QtGui\5.1.0\QtGui/qpa/qplatformopenglcontext.h:1,
    from C:\Qt\Qt5.1.0_static\qtbase\include\QtGui\5.1.0\QtGui/qpa/../../../../../src/gui/kernel/qplatformwindow.h:59,
    from C:\Qt\Qt5.1.0_static\qtbase\include\QtGui\5.1.0\QtGui/qpa/qplatformwindow.h:1,
    from C:\Qt\Qt5.1.0_static\qtbase\src\gui\kernel\qguiapplication.cpp:49:
    C:\Qt\Qt5.1.0_static\qtbase\include/QtGui/../../src/gui/opengl/qopengl.h:82:25: fatal error: GLES2/gl2.h: No such file or directory

    include <GLES2/gl2.h>

                         ^
    

    compilation terminated.
    Makefile.Release:18395: recipe for target '.obj/release_static/qguiapplication.o' failed
    mingw32-make[4]: *** [.obj/release_static/qguiapplication.o] Error 1
    mingw32-make[4]: Leaving directory 'C:/Qt/Qt5.1.0_static/5.1.0-qt-x64-build/qtbase/src/gui'
    Makefile:34: recipe for target 'release' failed
    mingw32-make[3]: *** [release] Error 2
    mingw32-make[3]: Leaving directory 'C:/Qt/Qt5.1.0_static/5.1.0-qt-x64-build/qtbase/src/gui'
    Makefile:305: recipe for target 'sub-gui-make_first' failed
    mingw32-make[2]: *** [sub-gui-make_first] Error 2
    mingw32-make[2]: Leaving directory 'C:/Qt/Qt5.1.0_static/5.1.0-qt-x64-build/qtbase/src'
    Makefile:40: recipe for target 'sub-src-make_first' failed
    mingw32-make[1]: *** [sub-src-make_first] Error 2
    mingw32-make[1]: Leaving directory 'C:/Qt/Qt5.1.0_static/5.1.0-qt-x64-build/qtbase'
    makefile:51: recipe for target 'module-qtbase-make_first' failed
    mingw32-make: *** [module-qtbase-make_first] Error 2@

    It seems that the first error is coming from OpenGL somehow? I'm assuming it isn't using the angle support?Even though I specified not to use it... any advice is appreciated. If I seemed to miss out on anything let me know and I'll edit it in!



  • Okay, so I changed the -no-opengl to -opengl desktop and it seemed to compile further but I ran into the problem of :

    @ar -M < object_script.libQt5Sql.Release
    mingw32-make[4]: Leaving directory 'C:/Qt/Qt5.1.0_static/5.1.0-qt-x64-build/qtbase/src/sql'
    mingw32-make[3]: Leaving directory 'C:/Qt/Qt5.1.0_static/5.1.0-qt-x64-build/qtbase/src/sql'
    mingw32-make[2]: Leaving directory 'C:/Qt/Qt5.1.0_static/5.1.0-qt-x64-build/qtbase/src'
    Makefile:40: recipe for target 'sub-src-make_first' failed
    mingw32-make[1]: *** [sub-src-make_first] Error 2
    mingw32-make[1]: Leaving directory 'C:/Qt/Qt5.1.0_static/5.1.0-qt-x64-build/qtbase'
    makefile:51: recipe for target 'module-qtbase-make_first' failed
    mingw32-make: *** [module-qtbase-make_first] Error 2@

    ... Whats with the Error 2's ? Back to researching it


  • Moderators

    welcome to devnet

    Did you do a confclean before reconfiguring?



  • Whenever I try to use confclean I get :
    @mingw32-make: *** No rule to make target `confclean'. Stop.@

    I have just been manually deleting previous configures and then configuring again... is this a problem ?


  • Moderators

    At least with Qt4 it was.

    What did it say at the end of the configure?
    Does it state that for a new configuration you should run confclean or similar?



  • It does, it tells me :
    @To reconfigure, run mingw32-make confclean and configure@
    but when I do try to access confclean it isn't there ( or doesn't work )

    Reconfigured by hand again and got this instead:
    @ar -M < object_script.libQt5Network.Release
    mingw32-make[4]: Leaving directory 'C:/Qt/Qt5.1.0_static/5.1.0-qt-x64-build/qtbase/src/network'
    mingw32-make[3]: Leaving directory 'C:/Qt/Qt5.1.0_static/5.1.0-qt-x64-build/qtbase/src/network'
    mingw32-make[2]: Leaving directory 'C:/Qt/Qt5.1.0_static/5.1.0-qt-x64-build/qtbase/src'
    Makefile:40: recipe for target 'sub-src-make_first' failed
    mingw32-make[1]: *** [sub-src-make_first] Error 2
    mingw32-make[1]: Leaving directory 'C:/Qt/Qt5.1.0_static/5.1.0-qt-x64-build/qtbase'
    makefile:51: recipe for target 'module-qtbase-make_first' failed
    mingw32-make: *** [module-qtbase-make_first] Error 2@

    Starting to get confused haha, instead of SQL this time its the network


  • Moderators

    You should issue a bug report on "JIRA":https://bugreports.qt-project.org/secure/Dashboard.jspa if the confclean problem is not reported yet.

    I did not compile Qt 5 myself yet. My experience is based on Qt 4 compilation. I had occasions where I started the make process several times and eventually it concluded successfully.

    Nevertheless, there is also the chance that the configuration is not carried properly. I would start fresh by deleting the current half build process and unzip source again.

    Do you follow any guidelines from somewhere?
    There is a wiki entry for static build "with gcc on windows for Qt 4.":http://qt-project.org/wiki/How_to_build_a_static_Qt_version_for_Windows_with_gcc Most of it should be still valid and only few, if any, diversions of the guide I would expect.



  • I'll look into if it has yet or not. I'm just trying to compile my current application as a static 64 bit application, would I be able to do such on a previous (say 4.8.0) version ? And I followed I'd say 4-5 different guides all from qt-project.org.
    I'll attempt to redo it and let you know how it turns out.


  • Moderators

    If your application is not Qt5 based, Qt 4.8 might be sufficient for you. There are moderate changes from Qt 4 to Qt 5.
    If you are starting with Qt it is not so relevant. Beware only of deprecated classes as QFtp for instance. This is not supported directly with Qt 5 anymore.
    Also it is not necessary to use either 64 bit or static. You need IMHO very good reasons to go to 64 bits. Also a lot of people feel uncomfortable with a dynamic version. However, there is no reason for. You can work with dlls as good as you can with a static build. For the static build you have to be aware of the license implications.



  • I created it on the Qt5 Creator (not built from source) but I am not quite sure if I used any functions specific to Qt5.
    What would be Pros/Cons of the 64 bit? My boss is looking for 64-bit processing to super-charge the power of the program ( since it is used to deal with massive processes ) . The problem with a dll build for me, is that even when running dependency walker to find needed dll files I still can't seem to find enough to make it run.

    And I just tried redoing it from scratch and it did not work, instead now its breaking even earlier saying there is no qconfig.h include


  • Moderators

    [quote author="RamanDS" date="1375297894"]I created it on the Qt5 Creator (not built from source) but I am not quite sure if I used any functions specific to Qt5.
    [/quote]

    Just a correction there is no Qt creator 5 at the moment. '5' is the major version number of Qt libs (the stuff you build your applications on). Qt creator is a "simple" IDE which is also using Qt 4 or Qt 5 libs. The version of the libs used by Qt creator does not matter when you are building your own applications.
    At top of the download page you can read
    [quote]
    Select the file according to your operating system from the list below to get the latest Qt 5.1 for your computer. The binary packages include Qt 5.1.0 libraries and Qt Creator 2.7.2
    [/quote]
    Further down, you can download Qt creator 2.8. For some mystery it is based on Qt 4.8. Probably some misunderstandings with project teams.

    [quote author="RamanDS" date="1375297894"]
    What would be Pros/Cons of the 64 bit? My boss is looking for 64-bit processing to super-charge the power of the program ( since it is used to deal with massive processes ) . [/quote]
    In general those statements sound logical. There are for sure applications which need 64 bit "power" (large arrays above 2 GB), but the additional is rather minimal AFAIK.
    Speed-wise I did not see a difference,yet. However, I have not really checked yet, but I did not have a "whow" experience.
    The applications require are getting bigger especially for debug configurations. I've git a "whow" experience there, but in a negative sense.
    Development can be done in 99% in 32 bit. 64 bit should be then a recompilation later on.

    [quote author="RamanDS" date="1375297894"]
    The problem with a dll build for me, is that even when running dependency walker to find needed dll files I still can't seem to find enough to make it run.
    [/quote]
    If you think of commercial applications not doing your stuff for fun, you should have a look to the "license conditions.":http://qt-project.org/products/licensing A static build has considerable restrictions.

    The important about dependency walker is to check also the path where it does find the dlls. In most cases I have encountered it finds a phony Qt dll somewhere which is based on another Qt version. The mix brings the incompatibility. Other than that there are typically one or two, but for sure less than a hand full compiler dependent dlls. The windows specific stuff seem to generate sometimes issues, when you go to another windows version. Luckily never encountered this yet.

    [quote author="RamanDS" date="1375297894"]
    And I just tried redoing it from scratch and it did not work, instead now its breaking even earlier saying there is no qconfig.h include [/quote]
    With deletion of the partly build, I had bad experience. I have started to keep the downloaded .zip and unzip every time. Speed-wise you require the same time.
    And once again, you should use the source of the .zip file anyhow and NOT the source as already supplied with the SDK.
    Finally, Qt 5.1 is reported as stable for static builds (Qt 5.0 was not). Nevertheless, there can be still some ripples.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.