【发布时间】:2020-01-11 07:11:57
【问题描述】:
- 如何让这个配置/构建过程正常工作?
- 为什么会出现下面提到的不同 QMAKE ERRORS(如果可能,请详细说明)?
源代码(带下载链接):
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/
我在以下目录中解压并成功构建 MariaDB 5.5.56:
D:\Source_Code-Third_Party\MariaDB\mariadb-5.5.56
Note: I "mkdir lib" and copy all ".lib"s into this folder post-build process.
然后我通过我编写的批处理脚本使用以下命令:
set QMAKESPEC=win32-msvc2015
set _ROOT=
set VS2015PATH="C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC"
pushd %VS2015PATH%
call vcvarsall.bat x64
popd
set CL=/MP
set INSTPREFIX=D:\Qt\5.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 src\plugins\sqldrivers\mysql
set longDir=D:\Source_Code-Third_Party\qt-everywhere-opensource-src-5.7.1
REM (QMAKE COMMAND THAT CAUSES ERROR)
%longDir%\qtbase\bin\qmake "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 qtbase\nmake take care of everything (including plugin)
REM nmake
cd ..\..\..\..
nmake
nmake install
使用上述(QMAKE ERROR COMMAND),我得到 ERROR:
Project ERRROR: No module claims plugin type 'sqldrivers'
当我将 (QMAKE ERROR COMMAND) 更改为以下内容时(使用不同的 qmake):
%longDir%\qtbase\qmake\qmake "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-not-loaded-but-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
- 如果有人/人们要回答这两个问题等等,那就太棒了!
- 提前谢谢大家!!
【问题讨论】:
标签: c++ mysql qt5 mariadb qmake