使用QT 5.8和SQL库配置错误

Configure error with Qt 5.8 and SQL libraries

本文关键字:配置 错误 SQL QT 使用      更新时间:2023-10-16

构建QT 5.7时,我曾经调用以下命令行:

c: sdk qt src configure -confirm -license-debug-and-release -force-debug-info -ltcg -ltcg -static-angle -nomake示例-Nomake Tests -QT-SQL-ODBC -QT-SQL-ODBC -QT-SQL-SQL-SQL-SQLITE z_prefix -skip qt3d -skip qtactiveqt -skip qtandroidextras -skipqtpurchasing -skip qttools -skip qtcanvas3d -skip qtConnectivity -skipqtdatavis3d -skip qtdeclarative -skip qtdoc -skip qtgamepad -skipqtgraphicalfects -skip qtimageformats -skip qtlocation -skipqtmacextras -skip qtmultimedia -skip qtquickcontrols2 -skip qtsensors-skip qtserialport -skip qtsvg -skip qtwayland -skip qtwebChannel -skip qtwebengine -skip qtwebsockets -skip qtwinextras -skip qtx11 Exttras -skip qtxmlpatterns -prepaterns -predek predek predek prefeck c:qud f ix pred

但是,使用QT 5.8,此命令行失败,以下错误消息:

错误:布尔命令行选项" sql-odbc'。

给出无效的值

错误:布尔命令行选项给出的无效值'sql-sqlite'。

根据QT 5.8文档,我的命令行似乎很好。

我该怎么办?

显然已重命名。并且该文档不是最新的。

正确的命令行是:

c: sdk qt src configure -confirm -license -debug and -release -force -debug -info -ltcg -static -angle -nomake示例-Nomake Tests -sql -odbc -sql -sql -sql -sqlite -qt -Zlib -d Z_prefix -skip qt3d -skip qtactiveqt -skip qtandroidextras -skip qtpurchasing -skip qttools -skip qtcanvas3d -skip qtcannectivity -skip qtconnectivity -skip qtdatavis3d -skip qtdatavis3d -skip qtdeclaration -skipskipskipsk qtmegke qumeds qumeckept- -skip qtimageformats -skip qtlocation -skip qtmacextras -skip qtmultimedia -skip qtquickcontrols2 -skip qtsensors -skip qtserialport -skip qtsvg -skip qtwayland -skip qtwebChannel -skip qtwebengine -skip qtwebsockets -skip qtwinextras -skip qtx11 Exttras -skip qtxmlpatterns -prepaterns -predek predek predek prefeck c:qud f ix pred

看来我们现在应该使用-sql<driver>而不是-qt-sql<driver>