- 如何使此配置/构建过程工作?
- 为什么下面提到的不同QMAKE错误(如果可能的话)?
源代码(W/下载链接):
MariaDB 5.5.56
https://downloads.mariadb.org/mariadb/5.5.56/
Qt 5.7.1
https://download.qt.io/official_releases/qt/5.7/5.7.1/single/
i unzip&在以下目录中成功构建Mariadb 5.5.56:
D:Source_Code-Third_PartyMariaDBmariadb-5.5.56
Note: I "mkdir lib" and copy all ".lib"s into this folder post-build process.
i然后通过我写的批处理脚本使用以下命令:
set QMAKESPEC=win32-msvc2015
set _ROOT=
set VS2015PATH="C:Program Files (x86)Microsoft Visual Studio 14.0VC"
pushd %VS2015PATH%
call vcvarsall.bat x64
popd
set CL=/MP
set INSTPREFIX=D:Qt5.7.1
set OPENSSL_PATH=%usefulStuff%
set OPENSSL_LIBS=%usefulStuff%libs
set INCLUDE=%usefulStuff%include;%INCLUDE%
set LIB=%usefulStuff%lib;%LIB%
set LIBPATH=%usefulStuff%lib;%LIBPATH%
cd qtbase
configure.bat -skip qtwebengine -skip qtpurchasing -skip qtlocation -skip qtconnectivity -mp -confirm-licence -nomake tests -nomake examples -debug-and-release -opensource -shared -dbus -mp -openssl -qtzlib -plugin-sql-mysql -I %usefulStuff%include -L %usefulStuff%lib -prefix %INSTPREFIX%
cd srcpluginssqldriversmysql
set longDir=D:Source_Code-Third_Partyqt-everywhere-opensource-src-5.7.1
REM (QMAKE COMMAND THAT CAUSES ERROR)
%longDir%qtbasebinqmake "INCLUDEPATH+= D:/Source_Code-Third_Party/MariaDB/mariadb-5.5.56/include" "LIBS+=D:/Source_Code-Third_Party/MariaDB/mariadb-5.5.56/lib/libmysql.lib" mysql.pro
REM unsure if I should do an nmake here as well, or will the qtbasenmake take care of everything (including plugin)
REM nmake
cd ........
nmake
nmake install
使用上述(qmake错误命令),我得到错误:
Project ERRROR: No module claims plugin type 'sqldrivers'
当我将(qmake error命令)更改为以下(使用不同的qmake)时:
%longDir%qtbaseqmakeqmake "INCLUDEPATH+= D:/Source_Code-Third_Party/MariaDB/mariadb-5.5.56/include" "LIBS+=D:/Source_Code-Third_Party/MariaDB/mariadb-5.5.56/lib/libmysql.lib" mysql.pro
我得到不同的错误:
Project ERROR: Cannot load qmodule.pri!
Error processing project file: mysql.pro
我能找到的一些参考文献:
https://forum.qt.io/topic/51808/notorious-qsqldatabase-qmysql-driver-driver-not-load-loaded-loaded-boaded-boaded-available/4
以下链接(QT文档)为代码格式,因为"您至少需要10个声誉才能发布2个以上的链接。"
http://doc.qt.io/qt-5/sql-driver.html#qmysql-for-mysql-4-and-higher
本来可以用" qmysql"标记这个问题,但是"创建新标签'qmysql'至少需要1500个声誉。试试一些来自现有标签列表的内容。"
-----下面是相关的,但我更关心上面提到的错误----
我不使用QT 5.8.0或5.9.0,因为我无法获得" -skip"," -plugin-sql-mysql"和/或/或" -QT-SQL-MYSQL"来使用configure.bat。我得到的错误:
"-qt-sql-mysql"
ERROR: Invalid value given for boolean command line option 'sql-mysql'.
OR
"-plugin-sql-mysql"
ERROR: Feature 'sql-mysql' was enabled, but the pre-condition 'libs.mysql' failed.
Check config.log for details.
OR
"-skip <somethingIShouldBeAbleToSkip>"
ERROR: Unknown command line option '-skip'.
我发现的QTbug参考之一:
https://bugreports.qt.io/browse/qtbug-58536
- 如果某人/人要回答问题&amp;更多,那真是太棒了!
- 谢谢大家!
我遵循以下说明在Windows上构建MariaDB:
https://mariadb.com/kb/en/the-mariadb-library/building_mariadb_on_windows/
构建后,您还应该继续安装到系统上。此安装过程将所有内容都放在QT构建过程的正确文件夹结构中。
安装了MariaDB(看起来像MySQL安装)后,您应该能够遵循MySQL的标准QT构建说明。
http://doc.qt.io/qt-5/sql-driver.html
使用与" -qt-sql-mysql -i c: progra" 〜1 mysql include -l c: progra〜1 mysql lib"配置qt时"时,使用类似的东西。我使用QT 5.7.1。
除了Snowman6286的答案外,还必须使用默认QT进行构建:
QT是正常使用/MD标志集构建的,因此必须以相同的方式构建MariaDB才能将其链接起来。违规行在。 cmake os windows.cmake。评论读取STRING(REPLACE "/MD" "/MT" "${flag}" "${${flag}}")
的行。此外,不要通过评论root cmakelists中读取 ADD_SUBDIRECTORY(win/upgrade_wizard)
的行来放任升级向导构建。