2017-02-27 50 views
4

在構建Qt的5.7,我用下面的命令行調用:配置錯誤使用Qt 5.8和SQL庫

C:\SDK\Qt\src\configure -commercial -confirm-license -debug-and-release -force-debug-info -ltcg -static -angle -nomake examples -nomake tests -qt-sql-odbc -qt-sql-sqlite -qt-zlib -D Z_PREFIX -skip qt3d -skip qtactiveqt -skip qtandroidextras -skip qtpurchasing -skip qttools -skip qtcanvas3d -skip qtconnectivity -skip qtdatavis3d -skip qtdeclarative -skip qtdoc -skip qtgamepad -skip qtgraphicaleffects -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 qtx11extras -skip qtxmlpatterns -prefix C:\SDK\Qt\x64

然而,使用Qt 5.8,該命令行失敗,出現以下錯誤消息:

ERROR: Invalid value given for boolean command line option 'sql-odbc'.

ERROR: Invalid value given for boolean command line option 'sql-sqlite'.

根據Qt 5.8 documentation,我的命令行看起來很好。

我該怎麼辦?

+0

http://stackoverflow.com/questions/41812121/qt-lite-and-configuration-changes-in-qt-5-8/41962051#41962051 – dtech

回答

6

顯然參數已被重命名。並且文檔不是最新的。

正確的命令行是:

C:\SDK\Qt\src\configure -commercial -confirm-license -debug-and-release -force-debug-info -ltcg -static -angle -nomake examples -nomake tests -sql-odbc -sql-sqlite -qt-zlib -D Z_PREFIX -skip qt3d -skip qtactiveqt -skip qtandroidextras -skip qtpurchasing -skip qttools -skip qtcanvas3d -skip qtconnectivity -skip qtdatavis3d -skip qtdeclarative -skip qtdoc -skip qtgamepad -skip qtgraphicaleffects -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 qtx11extras -skip qtxmlpatterns -prefix C:\SDK\Qt\x64

看起來我們現在應該使用-sql<driver>而不是-qt-sql<driver>