Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Build Qt 5.6 with system libs (problems with include order)

Build Qt 5.6 with system libs (problems with include order)

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
windowsqmakebootstrapconfigure
2 Posts 2 Posters 1.5k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    The2Ring
    wrote on 16 Feb 2016, 11:21 last edited by
    #1

    Hi,

    How to build Qt with -system-libs (zlib, libpng) etc.
    I tried to pass the install location using -I C:\qtinstall\include and -L C:\qtinstall\lib to configure, but then those passes are included before the qtmodule includes. Resulting in a build failure if an older qt build is present in this location.

    My configuration is:

    configure.bat -opensource -confirm-license -prefix s:\ -platform win32-g++ -plugin-sql-odbc -qt-style-windowsxp -qt-style-windowsvista -system-libpng -system-libjpeg -system-zlib -system-pcre -system-freetype -nomake examples -c++11 -opengl dynamic -force-debug-info -openssl-linked -plugin-sql-mysql -qdbus -dbus-linked -icu -ltcg -release -I s:\include -L s:\lib 
    

    -I and -L are then set in the qmodule.pri generated by qt.

     LIBS           += -Ls:/lib
     INCLUDEPATH    += s:/include
    

    I get similar results with mingw-w64 and msvc.

    When I don't try to use the system libs and I don't pass the -I and -L I have a similar issue when building qtmodules seperatly.
    For example if a module tries to use the builtin zlib the include to the installed qt base provided by QT_INSTALL_HEADERS is included before -Is:\include\QtZlib resulting in the wrong zconf.h being used.
    The result is that the code is looking for the zlib symbols without the z_ prefix which is used in the qt plugin.

    -IQ:\qtsvg\src\svg -I. -Is:\build\win32libs\icu\image-mingw-w64-RelWithDebInfo-55.1\include -I..\..\include -I..\..\include\QtSvg -I..\..\include\QtSvg\5.6.1 -I..\..\include\QtSvg\5.6.1\QtSvg -Itmp -Is:\include\QtWidgets\5.6.0 -Is:\include\QtWidgets\5.6.0\QtWidgets -Is:\include\QtGui\5.6.0 -Is:\include\QtGui\5.6.0\QtGui -Is:\include\QtCore\5.6.0 -Is:\include\QtCore\5.6.0\QtCore -Is:\include -Is:\include\QtWidgets -Is:\include\QtGui -Is:\include\QtANGLE -Is:\include\QtCore -Is:\include\QtZlib -Is:/include/QtZlib/5.6.0 -Is:/include/QtZlib/5.6.0/QtZlib -I.moc\release -Is:\mkspecs\win32-g++ -o .obj\release\moc_qsvgwidget.o .moc\release\moc_qsvgwidget.cpp
    

    Is there a way to change the include order or is it a Qt bug?

    K 1 Reply Last reply 16 Feb 2016, 11:37
    0
    • T The2Ring
      16 Feb 2016, 11:21

      Hi,

      How to build Qt with -system-libs (zlib, libpng) etc.
      I tried to pass the install location using -I C:\qtinstall\include and -L C:\qtinstall\lib to configure, but then those passes are included before the qtmodule includes. Resulting in a build failure if an older qt build is present in this location.

      My configuration is:

      configure.bat -opensource -confirm-license -prefix s:\ -platform win32-g++ -plugin-sql-odbc -qt-style-windowsxp -qt-style-windowsvista -system-libpng -system-libjpeg -system-zlib -system-pcre -system-freetype -nomake examples -c++11 -opengl dynamic -force-debug-info -openssl-linked -plugin-sql-mysql -qdbus -dbus-linked -icu -ltcg -release -I s:\include -L s:\lib 
      

      -I and -L are then set in the qmodule.pri generated by qt.

       LIBS           += -Ls:/lib
       INCLUDEPATH    += s:/include
      

      I get similar results with mingw-w64 and msvc.

      When I don't try to use the system libs and I don't pass the -I and -L I have a similar issue when building qtmodules seperatly.
      For example if a module tries to use the builtin zlib the include to the installed qt base provided by QT_INSTALL_HEADERS is included before -Is:\include\QtZlib resulting in the wrong zconf.h being used.
      The result is that the code is looking for the zlib symbols without the z_ prefix which is used in the qt plugin.

      -IQ:\qtsvg\src\svg -I. -Is:\build\win32libs\icu\image-mingw-w64-RelWithDebInfo-55.1\include -I..\..\include -I..\..\include\QtSvg -I..\..\include\QtSvg\5.6.1 -I..\..\include\QtSvg\5.6.1\QtSvg -Itmp -Is:\include\QtWidgets\5.6.0 -Is:\include\QtWidgets\5.6.0\QtWidgets -Is:\include\QtGui\5.6.0 -Is:\include\QtGui\5.6.0\QtGui -Is:\include\QtCore\5.6.0 -Is:\include\QtCore\5.6.0\QtCore -Is:\include -Is:\include\QtWidgets -Is:\include\QtGui -Is:\include\QtANGLE -Is:\include\QtCore -Is:\include\QtZlib -Is:/include/QtZlib/5.6.0 -Is:/include/QtZlib/5.6.0/QtZlib -I.moc\release -Is:\mkspecs\win32-g++ -o .obj\release\moc_qsvgwidget.o .moc\release\moc_qsvgwidget.cpp
      

      Is there a way to change the include order or is it a Qt bug?

      K Offline
      K Offline
      koahnig
      wrote on 16 Feb 2016, 11:37 last edited by koahnig
      #2

      @The2Ring

      welcome to devnet forum

      I have not done a build of Qt libs myself for some time. Therefore, I am not completely sure, but the building scripts are typically not happy about the use of backslashs '\'. Those are certainly the main folder separators for windows, but may need escaping. The scripts of Qt are originally coming from linux. Therefore in a lot of places it is better to use the forward slash '/' instead.

      I have seen that you have used already the forward slash with LIBS and INCLUDEPATH. So you are aware of the issue. However, you have used with configure.bat back slashes.

      In my opinion it is certainly worth a try with forward slashes. This is sometimes as a miracle and solving issues which are hard to understand.

      Vote the answer(s) that helped you to solve your issue(s)

      1 Reply Last reply
      0

      2/2

      16 Feb 2016, 11:37

      • Login

      • Login or register to search.
      2 out of 2
      • First post
        2/2
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved