Solved Qt 6 configure issues
-
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? Whatcmake
parameters should I use? Thank you. -
@Cobra91151 said in Qt 6 configure issues:
C:\MySQL\mysql-5.7.32-winx64\debug\include
You should use / instead of \
-
Ok. I will double check it and try again. Thank you.
-
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 :)
-
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
withMySQL
params from: https://codereview.qt-project.org/c/qt/qtbase/+/328916 -
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 byQt 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 tocmake
, 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 forMinGW
, but I useVS 2019
compiler, should be -libcryptoMTd.lib
.
I have found out that it reads thePATH
and it have found this wrong library inStrawberry Perl
directory.Configure log: https://pastebin.com/5vPDkds1
-
I have compiled
mysql-8.0.22-winx64
libs but it still can not find it bycmake
.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.
-
Thanks to lixinwei (https://bugreports.qt.io/browse/QTBUG-89993) the issue is resolved. Now, it successfully finds the
OpenSSL
andMySQL libs
.Cmake paramaters:
cmake -DCMAKE_BUILD_TYPE=Debug -DBUILD_SHARED_LIBS=OFF -DQT_BUILD_EXAMPLES=OFF -DINPUT_static_runtime=ON -DFEATURE_ltcg=OFF -DBUILD_qtwebengine=OFF -DOPENSSL_ROOT_DIR="C:\OpenSSL\openssl-1.1.1i\static\x64\debug" -DOPENSSL_USE_STATIC_LIBS=TRUE -DOPENSSL_MSVC_STATIC_RT=TRUE -DINPUT_sql_mysql=ON -DMySQL_INCLUDE_DIRS="C:\MySQL\mysql-5.7.32-winx64\debug\include" -DMySQL_LIBRARIES="C:\MySQL\mysql-5.7.32-winx64\debug\lib\mysqlclientMTd.lib" -DCMAKE_INSTALL_PREFIX="C:\QtStatic\6.0.0\msvc2019_64" -G Ninja C:\QtBuild\qt-everywhere-src-6.0.0