Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Qt 6 configure issues



  • Hello!

    I want to build Qt 6 with prebuilt MySQL/OpenSSL libs to try out new features, but I have some issues with configure parameters.

    For example, I have such configure parameters:
    configure.bat -debug -static -static-runtime -confirm-license -opensource -nomake examples -no-ltcg -sql-mysql -openssl-linked -prefix "C:\QtStatic\6.0.0\msvc2019_64"

    When I add the -sql-mysql or -openssl-linked parameters I got the following issue:

    CMake Error at qtbase/cmake/QtProcessConfigureArgs.cmake:788 (message):
      CMake exited with code 1.
    

    Also, I have tried to use -skip qtwebengine, but cmake returns BUILD_qtwebengine not used by the project. Using configure.bat/cmake it is quite confusing. Some of the parameters does not translate into cmake properly. Where I can get cmake parameters for -sql-mysql and -openssl-linked to build the Qt 6? What I want to do, is to manually translate the Qt configure.bat configure parameters into cmake and create some script for later usage (as I did for Qt 5). Thank you.



  • I have translated a few parameters to plain cmake:

    cmake -DCMAKE_BUILD_TYPE=Debug QT_NO_MAKE_EXAMPLES=ON -DFEATURE_ltcg=OFF -DCMAKE_INSTALL_PREFIX="C:\Test\6.0.0\msvc2019_64" -G Ninja C:\QtBuild\qt-everywhere-src-6.0.0
    

    But still need to translate those:

    -static -static-runtime -confirm-license -opensource -skip qtwebengine -openssl_linked -sql-mysql
    

    Any ideas? Thanks.



  • I have translated a few more parameters to cmake:

    cmake -DCMAKE_BUILD_TYPE=Debug -DBUILD_SHARED_LIBS=OFF -DQT_BUILD_EXAMPLES=OFF -DINPUT_static_runtime=ON -DFEATURE_ltcg=OFF -DCMAKE_INSTALL_PREFIX="C:\Test\6.0.0\msvc2019_64" -G Ninja C:\QtBuild\qt-everywhere-src-6.0.0
    

    But still can not find any docs how to translate those: -confirm-license -opensource -skip qtwebengine -openssl_linked -sql-mysql

    I have previously built MySQL libs by using CMake Option Reference: https://dev.mysql.com/doc/mysql-sourcebuild-excerpt/8.0/en/source-configuration-options.html#cmake-option-reference

    Is there any similar reference available for Qt 6? Thank you.



  • When you run ./configure you should be able to see the equivalent CMake parameters on top of the configure output.
    You can also run ccmake after cmake to see the parameters.

    -DBUILD_qtwebengine=OFF
    
    -DINPUT_sql_mysql=ON
    
    -DINPUT_openssl=linked
    

    I'm not sure -confirm-license and -opensource is used anymore.



  • @Cobra91151 said in Qt 6 configure issues:

    confirm-license

    The license options are removed and ignored in Qt 6. see: https://doc.qt.io/qt-6/qt6-buildsystem.html

    *We removed both selections in Qt 6. The choice of licenses that are available to you depends on any legal contracts you have with The Qt Company, not on any artifacts.

    The configure options -opensource, -commercial, and -confirm-license are ignored in Qt 6, and might be removed in future versions of Qt.*



  • @Jonas-Kvinge

    I have tried configure -cmake, but it leads to the following error:

    + C:\QtBuild\qt-everywhere-src-6.0.0\qtbase\configure.bat -top-level -cmake -debug -static -static-runtime -mp -nomake examples -no-ltcg -sql-mysql -skip qtwebengine -I "C:\MySQL\mysql-5.7.32-winx64\debug\include" -L "C:\MySQL\mysql-5.7.32-winx64\debug\lib" MYSQL_LIBS="-lmysqlclientMTd_vs2017 -lAdvapi32 -lUser32 -lCrypt32 -lGdi32" -ssl -openssl -openssl-linked -I "C:\OpenSSL\openssl-1.1.1i\static\x64\debug\include" -L "C:\OpenSSL\openssl-1.1.1i\static\x64\debug\lib" OPENSSL_LIBS="-llibcryptoMTd -llibsslMTd -lUser32 -lAdvapi32 -lGdi32 -lCrypt32 -lWs2_32" -prefix "C:\QtStatic\6.0.0\msvc2019_64"
    -- Cache values
    CMake Error at qtbase/cmake/QtProcessConfigureArgs.cmake:227 (message):
      Invalid command line parameter
      'C:\\MySQL\\mysql-5.7.32-winx64\\debug\\lib'.
    Call Stack (most recent call first):
      qtbase/cmake/QtProcessConfigureArgs.cmake:503 (qtConfAddError)
    

    When you run ./configure you should be able to see the equivalent CMake parameters on top of the configure output.
    You are right, but not all parameters are displayed there.

    Also, I have tried to see the parameters using ccmake parameter when run configure:

    + C:\QtBuild\qt-everywhere-src-6.0.0\qtbase\configure.bat -top-level -cmake -ccmake -debug -static -static-runtime -mp -nomake examples -no-ltcg -sql-mysql -skip qtwebengine -I "C:\MySQL\mysql-5.7.32-winx64\debug\include" -L "C:\MySQL\mysql-5.7.32-winx64\debug\lib" MYSQL_LIBS="-lmysqlclientMTd -lAdvapi32 -lUser32 -lCrypt32 -lGdi32" -ssl -openssl -openssl-linked -I "C:\OpenSSL\openssl-1.1.1i\static\x64\debug\include" -L "C:\OpenSSL\openssl-1.1.1i\static\x64\debug\lib" OPENSSL_LIBS="-llibcryptoMTd -llibsslMTd -lUser32 -lAdvapi32 -lGdi32 -lCrypt32 -lWs2_32" -prefix "C:\QtStatic\6.0.0\msvc2019_64"
    -- Cache values
    CMake Error at qtbase/cmake/QtProcessConfigureArgs.cmake:227 (message):
      Unknown command line option '-ccmake'.
    Call Stack (most recent call first):
      qtbase/cmake/QtProcessConfigureArgs.cmake:531 (qtConfAddError)
    

    I tried to use the plain cmake: cmake ccmake -DCMAKE_BUILD_TYPE=Debug -DBUILD_SHARED_LIBS=OFF -DQT_BUILD_EXAMPLES=OFF -DINPUT_static_runtime=ON -DFEATURE_ltcg=OFF -DBUILD_qtwebengine=OFF -DINPUT_sql_mysql=ON -DINPUT_openssl=linked -DOPENSSL_USE_STATIC_LIBS=ON -DOPENSSL_ROOTDIR="C:\OpenSSL\openssl-1.1.1i\static\x64\debug" -DCMAKE_INSTALL_PREFIX="C:\QtStatic\6.0.0\msvc2019_64" -G Ninja C:\QtBuild\qt-everywhere-src-6.0.0

    -- Configuring incomplete, errors occurred!
    See also "C:/QtBuild/qt-everywhere-src-6.0.0/CMakeFiles/CMakeOutput.log".
    See also "C:/QtBuild/qt-everywhere-src-6.0.0/CMakeFiles/CMakeError.log".
    

    Full output: https://pastebin.com/XBS6Mxpn

    It has found a wrong static OpenSSL library: -- Found OpenSSL: C:/Strawberry/c/lib/libcrypto.a (found version "1.1.0h")
    I use VS 2019 as my compiler and I have the appropriate libraries in this path: -DOPENSSL_ROOTDIR="C:\OpenSSL\openssl-1.1.1i\static\x64\debug"

    I think it leads to error due to a missing OpenSSL/MySQL libs. How to provide paths for such libs? What cmake parameters should I use? Thank you.


  • Lifetime Qt Champion

    @Cobra91151 said in Qt 6 configure issues:

    C:\MySQL\mysql-5.7.32-winx64\debug\include

    You should use / instead of \



  • @jsulm

    Ok. I will double check it and try again. Thank you.


  • Moderators

    We're just about to update the documentation on how to build and configure the SQL plugins in Qt 6: https://codereview.qt-project.org/c/qt/qtbase/+/328916 . Feel free to try out and give feedback :)



  • @jsulm

    I have changed to / instead of \. But it is still the same.

    CMake Error at qtbase/cmake/QtProcessConfigureArgs.cmake:227 (message):
      Invalid command line parameter 'C:/MySQL/mysql-5.7.32-winx64/debug/lib'.
    Call Stack (most recent call first):
      qtbase/cmake/QtProcessConfigureArgs.cmake:503 (qtConfAddError)
    

    Now I will use only plain cmake with MySQL params from: https://codereview.qt-project.org/c/qt/qtbase/+/328916



  • @kkoehne

    I have added the following MySQL params: DMySQL_INCLUDE_DIR="C:\MySQL\mysql-5.7.32-winx64\debug\include" -DMySQL_LIBRARY="C:\MySQL\mysql-5.7.32-winx64\debug\lib\mysqlclientMTd.lib"

    I have used the plain cmake:

    cmake -DCMAKE_BUILD_TYPE=Debug -DBUILD_SHARED_LIBS=OFF -DQT_BUILD_EXAMPLES=OFF -DINPUT_static_runtime=ON -DFEATURE_ltcg=OFF -DBUILD_qtwebengine=OFF -DINPUT_sql_mysql=ON -DMySQL_INCLUDE_DIR="C:\MySQL\mysql-5.7.32-winx64\debug\include" -DMySQL_LIBRARY="C:\MySQL\mysql-5.7.32-winx64\debug\lib\mysqlclientMTd.lib" -DINPUT_openssl=linked -DOPENSSL_USE_STATIC_LIBS=ON -DOPENSSL_ROOTDIR="C:\OpenSSL\openssl-1.1.1i\static\x64\debug" -DCMAKE_INSTALL_PREFIX="C:\QtStatic\6.0.0\msvc2019_64" -G Ninja C:\QtBuild\qt-everywhere-src-6.0.0
    

    Full log: https://pastebin.com/MCbFx04U

    What is a minimum supported MySQL version by Qt 6? Because from the docs (https://codereview.qt-project.org/c/qt/qtbase/+/328916/6/src/sql/doc/snippets/code/doc_src_sql-driver.qdoc#88): mysql-8.0.22? Thank you.



  • I have specified the -DOPENSSL_USE_STATIC_LIBS=ON -DOPENSSL_ROOTDIR="C:\OpenSSL\openssl-1.1.1i\static\x64\debug" -DOPENSSL_CRYPTO_LIBRARY="C:\OpenSSL\openssl-1.1.1i\static\x64\debug\lib\libcryptoMTd.lib" parameters to cmake, but it still uses the wrong openssl library: -- Found OpenSSL: C:/Strawberry/c/lib/libcrypto.a (found version "1.1.0h")

    libcrypto.a it is a static lib for MinGW, but I use VS 2019 compiler, should be - libcryptoMTd.lib.
    I have found out that it reads the PATH and it have found this wrong library in Strawberry Perl directory.

    Configure log: https://pastebin.com/5vPDkds1



  • I have compiled mysql-8.0.22-winx64 libs but it still can not find it by cmake.

    Cmake parameters:

    cmake -DCMAKE_BUILD_TYPE=Debug -DBUILD_SHARED_LIBS=OFF -DQT_BUILD_EXAMPLES=OFF -DINPUT_static_runtime=ON -DFEATURE_ltcg=OFF -DBUILD_qtwebengine=OFF -DINPUT_sql_mysql=ON -DMySQL_INCLUDE_DIR="C:\MySQL\mysql-8.0.22-winx64\debug\include" -DMySQL_LIBRARY="C:\MySQL\mysql-8.0.22-winx64\debug\lib\mysqlclientMTd.lib" -DINPUT_openssl=linked -DOPENSSL_USE_STATIC_LIBS=ON -DOPENSSL_ROOTDIR="C:\OpenSSL\openssl-1.1.1i\static\x64\debug" -DOPENSSL_CRYPTO_LIBRARY="C:\OpenSSL\openssl-1.1.1i\static\x64\debug\lib\libcryptoMTd.lib" -DCMAKE_INSTALL_PREFIX="C:\QtStatic\6.0.0\msvc2019_64" -G Ninja C:\QtBuild\qt-everywhere-src-6.0.0
    

    Also, it has found the wrong OpenSSL lib again:

    -- Found OpenSSL: C:/Strawberry/c/lib/libcrypto.a (found version "1.1.0h")
    

    Full cmake log: https://pastebin.com/JyViJ6Gh



  • I have reported it and provided the feedback here: https://bugreports.qt.io/browse/QTBUG-89993

    Thank you.


Log in to reply