Trying to build mysql driver in Qt 6.1.3 and MySQL 8.0
-
Qt6 use a new way to build mysql drive, and I build it failed.
environment:
Visual Studio 2022
Qt 6.1.3(64bit & MSVC_2019_64)
MySQL 8.0(64bit)I have read this document
https://doc-snapshots.qt.io/qt6-6.1/sql-driver.html#qmysqlI input these commands:
cd C:\Qt\6.1.3\Src\qtbase\src\plugins\sqldrivers\mysql\build-sqldrivers
qt-cmake -G"Ninja" C:\Qt\6.1.3\Src\qtbase\src\plugins\sqldrivers -DCMAKE_INSTALL_PREFIX=C:\Qt\6.1.3\msvc2019_64 -DMySQL_INCLUDE_DIR="C:\Program Files\MySQL\MySQL Server 8.0\include" -DMySQL_LIBRARY="C:\Program Files\MySQL\MySQL Server 8.0\lib\libmysql.lib"
cmake --build . cmake --install .
I got error when I try to build:
[1/13] Building CXX object odbc/CMakeFiles/QODBCDriverPlugin.dir/main.cpp.obj
FAILED: odbc/CMakeFiles/QODBCDriverPlugin.dir/main.cpp.obj
C:\PROGRA~1\MINGW-~1\X86_64~1.0-W\mingw64\bin\C__~1.EXE -DQODBCDriverPlugin_EXPORTS -DQT_CORE_LIB -DQT_DEPRECATED_WARNINGS -DQT_DEPRECATED_WARNINGS_SINCE=0x060000 -DQT_DISABLE_DEPRECATED_BEFORE=0x040800 -DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII -DQT_NO_DEBUG -DQT_NO_EXCEPTIONS -DQT_PLUGIN -DQT_SQL_LIB -DUNICODE -DWIN32 -DWIN64 -D_CRT_SECURE_NO_WARNINGS -D_ENABLE_EXTENDED_ALIGNED_STORAGE -D_UNICODE -D_WIN64 -IC:/Qt/6.1.3/Src/qtbase/src/plugins/sqldrivers/mysql/build-sqldrivers/odbc/QODBCDriverPlugin_autogen/include -IC:/Qt/6.1.3/Src/qtbase/src/plugins/sqldrivers/odbc -IC:/Qt/6.1.3/Src/qtbase/src/plugins/sqldrivers/mysql/build-sqldrivers/odbc -IC:/Qt/6.1.3/Src/qtbase/src/plugins/sqldrivers/mysql/build-sqldrivers/include -isystem C:/Qt/6.1.3/msvc2019_64/include/QtCore -isystem C:/Qt/6.1.3/msvc2019_64/include -isystem C:/Qt/6.1.3/msvc2019_64/mkspecs/win32-msvc -isystem C:/Qt/6.1.3/msvc2019_64/include/QtCore/6.1.3 -isystem C:/Qt/6.1.3/msvc2019_64/include/QtCore/6.1.3/QtCore -isystem C:/Qt/6.1.3/msvc2019_64/include/QtSql/6.1.3 -isystem C:/Qt/6.1.3/msvc2019_64/include/QtSql/6.1.3/QtSql -isystem C:/Qt/6.1.3/msvc2019_64/include/QtSql -DNDEBUG -O2 -Wall -Wextra -fno-exceptions -Zc:cplusplus -permissive- -utf-8 -pthread -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zc:externConstexpr -Zc:wchar_t -guard:cf -std=c++17 -MD -MT odbc/CMakeFiles/QODBCDriverPlugin.dir/main.cpp.obj -MF odbc\CMakeFiles\QODBCDriverPlugin.dir\main.cpp.obj.d -o odbc/CMakeFiles/QODBCDriverPlugin.dir/main.cpp.obj -c C:/Qt/6.1.3/Src/qtbase/src/plugins/sqldrivers/odbc/main.cpp
C~1.EXE: error: unrecognized debug output level 'uard:cf'
C__~1.EXE: error: unrecognized command line option '-Zc:cplusplus'
C~1.EXE: error: unrecognized command line option '-permissive-'; did you mean '-fpermissive'?
C__~1.EXE: error: unrecognized command line option '-Zc:rvalueCast'
C__~1.EXE: error: unrecognized command line option '-Zc:inline'; did you mean '-Winline'?
C__~1.EXE: error: unrecognized command line option '-Zc:strictStrings'
C__~1.EXE: error: unrecognized command line option '-Zc:throwingNew'
C__~1.EXE: error: unrecognized command line option '-Zc:referenceBinding'
C__~1.EXE: error: unrecognized command line option '-Zc:externConstexpr'
C__~1.EXE: error: unrecognized command line option '-Zc:wchar_t'
[2/13] Building CXX object mysql/CMakeFiles/QMYSQLDriverPlugin.dir/QMYSQLDriverPlugin_autogen/mocs_compilation.cpp.obj
FAILED: mysql/CMakeFiles/QMYSQLDriverPlugin.dir/QMYSQLDriverPlugin_autogen/mocs_compilation.cpp.obj
C:\PROGRA~1\MINGW-~1\X86_64~1.0-W\mingw64\bin\C__~1.EXE -DQMYSQLDriverPlugin_EXPORTS -DQT_CORE_LIB -DQT_DEPRECATED_WARNINGS -DQT_DEPRECATED_WARNINGS_SINCE=0x060000 -DQT_DISABLE_DEPRECATED_BEFORE=0x040800 -DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII -DQT_NO_DEBUG -DQT_NO_EXCEPTIONS -DQT_PLUGIN -DQT_SQL_LIB -DUNICODE -DWIN32 -DWIN64 -D_CRT_SECURE_NO_WARNINGS -D_ENABLE_EXTENDED_ALIGNED_STORAGE -D_UNICODE -D_WIN64 -IC:/Qt/6.1.3/Src/qtbase/src/plugins/sqldrivers/mysql/build-sqldrivers/mysql/QMYSQLDriverPlugin_autogen/include -IC:/Qt/6.1.3/Src/qtbase/src/plugins/sqldrivers/mysql -IC:/Qt/6.1.3/Src/qtbase/src/plugins/sqldrivers/mysql/build-sqldrivers/mysql -IC:/Qt/6.1.3/Src/qtbase/src/plugins/sqldrivers/mysql/build-sqldrivers/include -isystem "C:/Program Files/MySQL/MySQL Server 8.0/include" -isystem C:/Qt/6.1.3/msvc2019_64/include/QtCore -isystem C:/Qt/6.1.3/msvc2019_64/include -isystem C:/Qt/6.1.3/msvc2019_64/mkspecs/win32-msvc -isystem C:/Qt/6.1.3/msvc2019_64/include/QtCore/6.1.3 -isystem C:/Qt/6.1.3/msvc2019_64/include/QtCore/6.1.3/QtCore -isystem C:/Qt/6.1.3/msvc2019_64/include/QtSql/6.1.3 -isystem C:/Qt/6.1.3/msvc2019_64/include/QtSql/6.1.3/QtSql -isystem C:/Qt/6.1.3/msvc2019_64/include/QtSql -DNDEBUG -O2 -Wall -Wextra -fno-exceptions -Zc:cplusplus -permissive- -utf-8 -pthread -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zc:externConstexpr -Zc:wchar_t -guard:cf -std=c++17 -MD -MT mysql/CMakeFiles/QMYSQLDriverPlugin.dir/QMYSQLDriverPlugin_autogen/mocs_compilation.cpp.obj -MF mysql\CMakeFiles\QMYSQLDriverPlugin.dir\QMYSQLDriverPlugin_autogen\mocs_compilation.cpp.obj.d -o mysql/CMakeFiles/QMYSQLDriverPlugin.dir/QMYSQLDriverPlugin_autogen/mocs_compilation.cpp.obj -c C:/Qt/6.1.3/Src/qtbase/src/plugins/sqldrivers/mysql/build-sqldrivers/mysql/QMYSQLDriverPlugin_autogen/mocs_compilation.cpp
C~1.EXE: error: unrecognized debug output level 'uard:cf'
C__~1.EXE: error: unrecognized command line option '-Zc:cplusplus'
C~1.EXE: error: unrecognized command line option '-permissive-'; did you mean '-fpermissive'?
C__~1.EXE: error: unrecognized command line option '-Zc:rvalueCast'
C__~1.EXE: error: unrecognized command line option '-Zc:inline'; did you mean '-Winline'?
C__~1.EXE: error: unrecognized command line option '-Zc:strictStrings'
C__~1.EXE: error: unrecognized command line option '-Zc:throwingNew'
C__~1.EXE: error: unrecognized command line option '-Zc:referenceBinding'
C__~1.EXE: error: unrecognized command line option '-Zc:externConstexpr'
C__~1.EXE: error: unrecognized command line option '-Zc:wchar_t'
[3/13] Building CXX object mysql/CMakeFiles/QMYSQLDriverPlugin.dir/qsql_mysql.cpp.obj
FAILED: mysql/CMakeFiles/QMYSQLDriverPlugin.dir/qsql_mysql.cpp.obj
C:\PROGRA~1\MINGW-~1\X86_64~1.0-W\mingw64\bin\C__~1.EXE -DQMYSQLDriverPlugin_EXPORTS -DQT_CORE_LIB -DQT_DEPRECATED_WARNINGS -DQT_DEPRECATED_WARNINGS_SINCE=0x060000 -DQT_DISABLE_DEPRECATED_BEFORE=0x040800 -DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII -DQT_NO_DEBUG -DQT_NO_EXCEPTIONS -DQT_PLUGIN -DQT_SQL_LIB -DUNICODE -DWIN32 -DWIN64 -D_CRT_SECURE_NO_WARNINGS -D_ENABLE_EXTENDED_ALIGNED_STORAGE -D_UNICODE -D_WIN64 -IC:/Qt/6.1.3/Src/qtbase/src/plugins/sqldrivers/mysql/build-sqldrivers/mysql/QMYSQLDriverPlugin_autogen/include -IC:/Qt/6.1.3/Src/qtbase/src/plugins/sqldrivers/mysql -IC:/Qt/6.1.3/Src/qtbase/src/plugins/sqldrivers/mysql/build-sqldrivers/mysql -IC:/Qt/6.1.3/Src/qtbase/src/plugins/sqldrivers/mysql/build-sqldrivers/include -isystem "C:/Program Files/MySQL/MySQL Server 8.0/include" -isystem C:/Qt/6.1.3/msvc2019_64/include/QtCore -isystem C:/Qt/6.1.3/msvc2019_64/include -isystem C:/Qt/6.1.3/msvc2019_64/mkspecs/win32-msvc -isystem C:/Qt/6.1.3/msvc2019_64/include/QtCore/6.1.3 -isystem C:/Qt/6.1.3/msvc2019_64/include/QtCore/6.1.3/QtCore -isystem C:/Qt/6.1.3/msvc2019_64/include/QtSql/6.1.3 -isystem C:/Qt/6.1.3/msvc2019_64/include/QtSql/6.1.3/QtSql -isystem C:/Qt/6.1.3/msvc2019_64/include/QtSql -DNDEBUG -O2 -Wall -Wextra -fno-exceptions -Zc:cplusplus -permissive- -utf-8 -pthread -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zc:externConstexpr -Zc:wchar_t -guard:cf -std=c++17 -MD -MT mysql/CMakeFiles/QMYSQLDriverPlugin.dir/qsql_mysql.cpp.obj -MF mysql\CMakeFiles\QMYSQLDriverPlugin.dir\qsql_mysql.cpp.obj.d -o mysql/CMakeFiles/QMYSQLDriverPlugin.dir/qsql_mysql.cpp.obj -c C:/Qt/6.1.3/Src/qtbase/src/plugins/sqldrivers/mysql/qsql_mysql.cpp
C~1.EXE: error: unrecognized debug output level 'uard:cf'
C__~1.EXE: error: unrecognized command line option '-Zc:cplusplus'
C~1.EXE: error: unrecognized command line option '-permissive-'; did you mean '-fpermissive'?
C__~1.EXE: error: unrecognized command line option '-Zc:rvalueCast'
C__~1.EXE: error: unrecognized command line option '-Zc:inline'; did you mean '-Winline'?
C__~1.EXE: error: unrecognized command line option '-Zc:strictStrings'
C__~1.EXE: error: unrecognized command line option '-Zc:throwingNew'
C__~1.EXE: error: unrecognized command line option '-Zc:referenceBinding'
C__~1.EXE: error: unrecognized command line option '-Zc:externConstexpr'
C__~1.EXE: error: unrecognized command line option '-Zc:wchar_t'
[4/13] Building CXX object sqlite/CMakeFiles/QSQLiteDriverPlugin.dir/qsql_sqlite.cpp.obj
FAILED: sqlite/CMakeFiles/QSQLiteDriverPlugin.dir/qsql_sqlite.cpp.obj
C:\PROGRA~1\MINGW-~1\X86_64~1.0-W\mingw64\bin\C__~1.EXE -DNDEBUG -DQSQLiteDriverPlugin_EXPORTS -DQT_CORE_LIB -DQT_DEPRECATED_WARNINGS -DQT_DEPRECATED_WARNINGS_SINCE=0x060000 -DQT_DISABLE_DEPRECATED_BEFORE=0x040800 -DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII -DQT_NO_DEBUG -DQT_NO_EXCEPTIONS -DQT_PLUGIN -DQT_SQL_LIB -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_RTREE -DSQLITE_OMIT_COMPLETE -DSQLITE_OMIT_LOAD_EXTENSION -DUNICODE -DWIN32 -DWIN64 -D_CRT_SECURE_NO_WARNINGS -D_ENABLE_EXTENDED_ALIGNED_STORAGE -D_UNICODE -D_WIN64 -IC:/Qt/6.1.3/Src/qtbase/src/plugins/sqldrivers/mysql/build-sqldrivers/sqlite/QSQLiteDriverPlugin_autogen/include -IC:/Qt/6.1.3/Src/qtbase/src/plugins/sqldrivers/sqlite -IC:/Qt/6.1.3/Src/qtbase/src/plugins/sqldrivers/mysql/build-sqldrivers/sqlite -IC:/Qt/6.1.3/Src/qtbase/src/plugins/sqldrivers/mysql/build-sqldrivers/include -IC:/Qt/6.1.3/Src/qtbase/src/plugins/sqldrivers/sqlite/../../../3rdparty/sqlite -isystem C:/Qt/6.1.3/msvc2019_64/include/QtCore -isystem C:/Qt/6.1.3/msvc2019_64/include -isystem C:/Qt/6.1.3/msvc2019_64/mkspecs/win32-msvc -isystem C:/Qt/6.1.3/msvc2019_64/include/QtCore/6.1.3 -isystem C:/Qt/6.1.3/msvc2019_64/include/QtCore/6.1.3/QtCore -isystem C:/Qt/6.1.3/msvc2019_64/include/QtSql/6.1.3 -isystem C:/Qt/6.1.3/msvc2019_64/include/QtSql/6.1.3/QtSql -isystem C:/Qt/6.1.3/msvc2019_64/include/QtSql -DNDEBUG -O2 -w -fno-exceptions -Zc:cplusplus -permissive- -utf-8 -pthread -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zc:externConstexpr -Zc:wchar_t -guard:cf -std=c++17 -MD -MT sqlite/CMakeFiles/QSQLiteDriverPlugin.dir/qsql_sqlite.cpp.obj -MF sqlite\CMakeFiles\QSQLiteDriverPlugin.dir\qsql_sqlite.cpp.obj.d -o sqlite/CMakeFiles/QSQLiteDriverPlugin.dir/qsql_sqlite.cpp.obj -c C:/Qt/6.1.3/Src/qtbase/src/plugins/sqldrivers/sqlite/qsql_sqlite.cpp
C~1.EXE: error: unrecognized debug output level 'uard:cf'
C__~1.EXE: error: unrecognized command line option '-Zc:cplusplus'
C~1.EXE: error: unrecognized command line option '-permissive-'; did you mean '-fpermissive'?
C__~1.EXE: error: unrecognized command line option '-Zc:rvalueCast'
C__~1.EXE: error: unrecognized command line option '-Zc:inline'; did you mean '-Winline'?
C__~1.EXE: error: unrecognized command line option '-Zc:strictStrings'
C__~1.EXE: error: unrecognized command line option '-Zc:throwingNew'
C__~1.EXE: error: unrecognized command line option '-Zc:referenceBinding'
C__~1.EXE: error: unrecognized command line option '-Zc:externConstexpr'
C__~1.EXE: error: unrecognized command line option '-Zc:wchar_t'
[5/13] Building CXX object sqlite/CMakeFiles/QSQLiteDriverPlugin.dir/smain.cpp.obj
FAILED: sqlite/CMakeFiles/QSQLiteDriverPlugin.dir/smain.cpp.obj
C:\PROGRA~1\MINGW-~1\X86_64~1.0-W\mingw64\bin\C__~1.EXE -DNDEBUG -DQSQLiteDriverPlugin_EXPORTS -DQT_CORE_LIB -DQT_DEPRECATED_WARNINGS -DQT_DEPRECATED_WARNINGS_SINCE=0x060000 -DQT_DISABLE_DEPRECATED_BEFORE=0x040800 -DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII -DQT_NO_DEBUG -DQT_NO_EXCEPTIONS -DQT_PLUGIN -DQT_SQL_LIB -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_RTREE -DSQLITE_OMIT_COMPLETE -DSQLITE_OMIT_LOAD_EXTENSION -DUNICODE -DWIN32 -DWIN64 -D_CRT_SECURE_NO_WARNINGS -D_ENABLE_EXTENDED_ALIGNED_STORAGE -D_UNICODE -D_WIN64 -IC:/Qt/6.1.3/Src/qtbase/src/plugins/sqldrivers/mysql/build-sqldrivers/sqlite/QSQLiteDriverPlugin_autogen/include -IC:/Qt/6.1.3/Src/qtbase/src/plugins/sqldrivers/sqlite -IC:/Qt/6.1.3/Src/qtbase/src/plugins/sqldrivers/mysql/build-sqldrivers/sqlite -IC:/Qt/6.1.3/Src/qtbase/src/plugins/sqldrivers/mysql/build-sqldrivers/include -IC:/Qt/6.1.3/Src/qtbase/src/plugins/sqldrivers/sqlite/../../../3rdparty/sqlite -isystem C:/Qt/6.1.3/msvc2019_64/include/QtCore -isystem C:/Qt/6.1.3/msvc2019_64/include -isystem C:/Qt/6.1.3/msvc2019_64/mkspecs/win32-msvc -isystem C:/Qt/6.1.3/msvc2019_64/include/QtCore/6.1.3 -isystem C:/Qt/6.1.3/msvc2019_64/include/QtCore/6.1.3/QtCore -isystem C:/Qt/6.1.3/msvc2019_64/include/QtSql/6.1.3 -isystem C:/Qt/6.1.3/msvc2019_64/include/QtSql/6.1.3/QtSql -isystem C:/Qt/6.1.3/msvc2019_64/include/QtSql -DNDEBUG -O2 -w -fno-exceptions -Zc:cplusplus -permissive- -utf-8 -pthread -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zc:externConstexpr -Zc:wchar_t -guard:cf -std=c++17 -MD -MT sqlite/CMakeFiles/QSQLiteDriverPlugin.dir/smain.cpp.obj -MF sqlite\CMakeFiles\QSQLiteDriverPlugin.dir\smain.cpp.obj.d -o sqlite/CMakeFiles/QSQLiteDriverPlugin.dir/smain.cpp.obj -c C:/Qt/6.1.3/Src/qtbase/src/plugins/sqldrivers/sqlite/smain.cpp
C~1.EXE: error: unrecognized debug output level 'uard:cf'
C__~1.EXE: error: unrecognized command line option '-Zc:cplusplus'
C~1.EXE: error: unrecognized command line option '-permissive-'; did you mean '-fpermissive'?
C__~1.EXE: error: unrecognized command line option '-Zc:rvalueCast'
C__~1.EXE: error: unrecognized command line option '-Zc:inline'; did you mean '-Winline'?
C__~1.EXE: error: unrecognized command line option '-Zc:strictStrings'
C__~1.EXE: error: unrecognized command line option '-Zc:throwingNew'
C__~1.EXE: error: unrecognized command line option '-Zc:referenceBinding'
C__~1.EXE: error: unrecognized command line option '-Zc:externConstexpr'
C__~1.EXE: error: unrecognized command line option '-Zc:wchar_t'
[6/13] Building CXX object sqlite/CMakeFiles/QSQLiteDriver...n.dir/QSQLiteDriverPlugin_autogen/mocs_compilation.cpp.obj
FAILED: sqlite/CMakeFiles/QSQLiteDriverPlugin.dir/QSQLiteDriverPlugin_autogen/mocs_compilation.cpp.obj
C:\PROGRA~1\MINGW-~1\X86_64~1.0-W\mingw64\bin\C__~1.EXE -DNDEBUG -DQSQLiteDriverPlugin_EXPORTS -DQT_CORE_LIB -DQT_DEPRECATED_WARNINGS -DQT_DEPRECATED_WARNINGS_SINCE=0x060000 -DQT_DISABLE_DEPRECATED_BEFORE=0x040800 -DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII -DQT_NO_DEBUG -DQT_NO_EXCEPTIONS -DQT_PLUGIN -DQT_SQL_LIB -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_RTREE -DSQLITE_OMIT_COMPLETE -DSQLITE_OMIT_LOAD_EXTENSION -DUNICODE -DWIN32 -DWIN64 -D_CRT_SECURE_NO_WARNINGS -D_ENABLE_EXTENDED_ALIGNED_STORAGE -D_UNICODE -D_WIN64 -IC:/Qt/6.1.3/Src/qtbase/src/plugins/sqldrivers/mysql/build-sqldrivers/sqlite/QSQLiteDriverPlugin_autogen/include -IC:/Qt/6.1.3/Src/qtbase/src/plugins/sqldrivers/sqlite -IC:/Qt/6.1.3/Src/qtbase/src/plugins/sqldrivers/mysql/build-sqldrivers/sqlite -IC:/Qt/6.1.3/Src/qtbase/src/plugins/sqldrivers/mysql/build-sqldrivers/include -IC:/Qt/6.1.3/Src/qtbase/src/plugins/sqldrivers/sqlite/../../../3rdparty/sqlite -isystem C:/Qt/6.1.3/msvc2019_64/include/QtCore -isystem C:/Qt/6.1.3/msvc2019_64/include -isystem C:/Qt/6.1.3/msvc2019_64/mkspecs/win32-msvc -isystem C:/Qt/6.1.3/msvc2019_64/include/QtCore/6.1.3 -isystem C:/Qt/6.1.3/msvc2019_64/include/QtCore/6.1.3/QtCore -isystem C:/Qt/6.1.3/msvc2019_64/include/QtSql/6.1.3 -isystem C:/Qt/6.1.3/msvc2019_64/include/QtSql/6.1.3/QtSql -isystem C:/Qt/6.1.3/msvc2019_64/include/QtSql -DNDEBUG -O2 -w -fno-exceptions -Zc:cplusplus -permissive- -utf-8 -pthread -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zc:externConstexpr -Zc:wchar_t -guard:cf -std=c++17 -MD -MT sqlite/CMakeFiles/QSQLiteDriverPlugin.dir/QSQLiteDriverPlugin_autogen/mocs_compilation.cpp.obj -MF sqlite\CMakeFiles\QSQLiteDriverPlugin.dir\QSQLiteDriverPlugin_autogen\mocs_compilation.cpp.obj.d -o sqlite/CMakeFiles/QSQLiteDriverPlugin.dir/QSQLiteDriverPlugin_autogen/mocs_compilation.cpp.obj -c C:/Qt/6.1.3/Src/qtbase/src/plugins/sqldrivers/mysql/build-sqldrivers/sqlite/QSQLiteDriverPlugin_autogen/mocs_compilation.cpp
C~1.EXE: error: unrecognized debug output level 'uard:cf'
C__~1.EXE: error: unrecognized command line option '-Zc:cplusplus'
C~1.EXE: error: unrecognized command line option '-permissive-'; did you mean '-fpermissive'?
C__~1.EXE: error: unrecognized command line option '-Zc:rvalueCast'
C__~1.EXE: error: unrecognized command line option '-Zc:inline'; did you mean '-Winline'?
C__~1.EXE: error: unrecognized command line option '-Zc:strictStrings'
C__~1.EXE: error: unrecognized command line option '-Zc:throwingNew'
C__~1.EXE: error: unrecognized command line option '-Zc:referenceBinding'
C__~1.EXE: error: unrecognized command line option '-Zc:externConstexpr'
C__~1.EXE: error: unrecognized command line option '-Zc:wchar_t'
[7/13] Building C object sqlite/CMakeFiles/QSQLiteDriverPl...r/C_/Qt/6.1.3/Src/qtbase/src/3rdparty/sqlite/sqlite3.c.obj
FAILED: sqlite/CMakeFiles/QSQLiteDriverPlugin.dir/C_/Qt/6.1.3/Src/qtbase/src/3rdparty/sqlite/sqlite3.c.obj
C:\PROGRA~1\MINGW-~1\X86_64~1.0-W\mingw64\bin\gcc.exe -DNDEBUG -DQSQLiteDriverPlugin_EXPORTS -DQT_CORE_LIB -DQT_DEPRECATED_WARNINGS -DQT_DEPRECATED_WARNINGS_SINCE=0x060000 -DQT_DISABLE_DEPRECATED_BEFORE=0x040800 -DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII -DQT_NO_DEBUG -DQT_NO_EXCEPTIONS -DQT_PLUGIN -DQT_SQL_LIB -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_RTREE -DSQLITE_OMIT_COMPLETE -DSQLITE_OMIT_LOAD_EXTENSION -DUNICODE -DWIN32 -DWIN64 -D_CRT_SECURE_NO_WARNINGS -D_ENABLE_EXTENDED_ALIGNED_STORAGE -D_UNICODE -D_WIN64 -IC:/Qt/6.1.3/Src/qtbase/src/plugins/sqldrivers/mysql/build-sqldrivers/sqlite/QSQLiteDriverPlugin_autogen/include -IC:/Qt/6.1.3/Src/qtbase/src/plugins/sqldrivers/sqlite -IC:/Qt/6.1.3/Src/qtbase/src/plugins/sqldrivers/mysql/build-sqldrivers/sqlite -IC:/Qt/6.1.3/Src/qtbase/src/plugins/sqldrivers/mysql/build-sqldrivers/include -IC:/Qt/6.1.3/Src/qtbase/src/plugins/sqldrivers/sqlite/../../../3rdparty/sqlite -isystem C:/Qt/6.1.3/msvc2019_64/include/QtCore -isystem C:/Qt/6.1.3/msvc2019_64/include -isystem C:/Qt/6.1.3/msvc2019_64/mkspecs/win32-msvc -isystem C:/Qt/6.1.3/msvc2019_64/include/QtCore/6.1.3 -isystem C:/Qt/6.1.3/msvc2019_64/include/QtCore/6.1.3/QtCore -isystem C:/Qt/6.1.3/msvc2019_64/include/QtSql/6.1.3 -isystem C:/Qt/6.1.3/msvc2019_64/include/QtSql/6.1.3/QtSql -isystem C:/Qt/6.1.3/msvc2019_64/include/QtSql -DNDEBUG -O2 -w -fno-exceptions -Zc:cplusplus -permissive- -utf-8 -pthread -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zc:externConstexpr -Zc:wchar_t -guard:cf -std=c11 -MD -MT sqlite/CMakeFiles/QSQLiteDriverPlugin.dir/C/Qt/6.1.3/Src/qtbase/src/3rdparty/sqlite/sqlite3.c.obj -MF sqlite\CMakeFiles\QSQLiteDriverPlugin.dir\C\Qt\6.1.3\Src\qtbase\src\3rdparty\sqlite\sqlite3.c.obj.d -o sqlite/CMakeFiles/QSQLiteDriverPlugin.dir/C_/Qt/6.1.3/Src/qtbase/src/3rdparty/sqlite/sqlite3.c.obj -c C:/Qt/6.1.3/Src/qtbase/src/3rdparty/sqlite/sqlite3.c
gcc.exe: error: unrecognized debug output level 'uard:cf'
gcc.exe: error: unrecognized command line option '-Zc:cplusplus'
gcc.exe: error: unrecognized command line option '-permissive-'; did you mean '-fpermissive'?
gcc.exe: error: unrecognized command line option '-Zc:rvalueCast'
gcc.exe: error: unrecognized command line option '-Zc:inline'; did you mean '-Winline'?
gcc.exe: error: unrecognized command line option '-Zc:strictStrings'
gcc.exe: error: unrecognized command line option '-Zc:throwingNew'
gcc.exe: error: unrecognized command line option '-Zc:referenceBinding'
gcc.exe: error: unrecognized command line option '-Zc:externConstexpr'
gcc.exe: error: unrecognized command line option '-Zc:wchar_t'
[8/13] Building CXX object odbc/CMakeFiles/QODBCDriverPlugin.dir/QODBCDriverPlugin_autogen/mocs_compilation.cpp.obj
FAILED: odbc/CMakeFiles/QODBCDriverPlugin.dir/QODBCDriverPlugin_autogen/mocs_compilation.cpp.obj
C:\PROGRA~1\MINGW-~1\X86_64~1.0-W\mingw64\bin\C~1.EXE -DQODBCDriverPlugin_EXPORTS -DQT_CORE_LIB -DQT_DEPRECATED_WARNINGS -DQT_DEPRECATED_WARNINGS_SINCE=0x060000 -DQT_DISABLE_DEPRECATED_BEFORE=0x040800 -DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII -DQT_NO_DEBUG -DQT_NO_EXCEPTIONS -DQT_PLUGIN -DQT_SQL_LIB -DUNICODE -DWIN32 -DWIN64 -D_CRT_SECURE_NO_WARNINGS -D_ENABLE_EXTENDED_ALIGNED_STORAGE -D_UNICODE -D_WIN64 -IC:/Qt/6.1.3/Src/qtbase/src/plugins/sqldrivers/mysql/build-sqldrivers/odbc/QODBCDriverPlugin_autogen/include -IC:/Qt/6.1.3/Src/qtbase/src/plugins/sqldrivers/odbc -IC:/Qt/6.1.3/Src/qtbase/src/plugins/sqldrivers/mysql/build-sqldrivers/odbc -IC:/Qt/6.1.3/Src/qtbase/src/plugins/sqldrivers/mysql/build-sqldrivers/include -isystem C:/Qt/6.1.3/msvc2019_64/include/QtCore -isystem C:/Qt/6.1.3/msvc2019_64/include -isystem C:/Qt/6.1.3/msvc2019_64/mkspecs/win32-msvc -isystem C:/Qt/6.1.3/msvc2019_64/include/QtCore/6.1.3 -isystem C:/Qt/6.1.3/msvc2019_64/include/QtCore/6.1.3/QtCore -isystem C:/Qt/6.1.3/msvc2019_64/include/QtSql/6.1.3 -isystem C:/Qt/6.1.3/msvc2019_64/include/QtSql/6.1.3/QtSql -isystem C:/Qt/6.1.3/msvc2019_64/include/QtSql -DNDEBUG -O2 -Wall -Wextra -fno-exceptions -Zc:cplusplus -permissive- -utf-8 -pthread -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zc:externConstexpr -Zc:wchar_t -guard:cf -std=c++17 -MD -MT odbc/CMakeFiles/QODBCDriverPlugin.dir/QODBCDriverPlugin_autogen/mocs_compilation.cpp.obj -MF odbc\CMakeFiles\QODBCDriverPlugin.dir\QODBCDriverPlugin_autogen\mocs_compilation.cpp.obj.d -o odbc/CMakeFiles/QODBCDriverPlugin.dir/QODBCDriverPlugin_autogen/mocs_compilation.cpp.obj -c C:/Qt/6.1.3/Src/qtbase/src/plugins/sqldrivers/mysql/build-sqldrivers/odbc/QODBCDriverPlugin_autogen/mocs_compilation.cpp
C~1.EXE: error: unrecognized debug output level 'uard:cf'
C__~1.EXE: error: unrecognized command line option '-Zc:cplusplus'
C~1.EXE: error: unrecognized command line option '-permissive-'; did you mean '-fpermissive'?
C__~1.EXE: error: unrecognized command line option '-Zc:rvalueCast'
C__~1.EXE: error: unrecognized command line option '-Zc:inline'; did you mean '-Winline'?
C__~1.EXE: error: unrecognized command line option '-Zc:strictStrings'
C__~1.EXE: error: unrecognized command line option '-Zc:throwingNew'
C__~1.EXE: error: unrecognized command line option '-Zc:referenceBinding'
C__~1.EXE: error: unrecognized command line option '-Zc:externConstexpr'
C__~1.EXE: error: unrecognized command line option '-Zc:wchar_t'
[9/13] Building CXX object odbc/CMakeFiles/QODBCDriverPlugin.dir/qsql_odbc.cpp.obj
FAILED: odbc/CMakeFiles/QODBCDriverPlugin.dir/qsql_odbc.cpp.obj
C:\PROGRA~1\MINGW-~1\X86_64~1.0-W\mingw64\bin\C__~1.EXE -DQODBCDriverPlugin_EXPORTS -DQT_CORE_LIB -DQT_DEPRECATED_WARNINGS -DQT_DEPRECATED_WARNINGS_SINCE=0x060000 -DQT_DISABLE_DEPRECATED_BEFORE=0x040800 -DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII -DQT_NO_DEBUG -DQT_NO_EXCEPTIONS -DQT_PLUGIN -DQT_SQL_LIB -DUNICODE -DWIN32 -DWIN64 -D_CRT_SECURE_NO_WARNINGS -D_ENABLE_EXTENDED_ALIGNED_STORAGE -D_UNICODE -D_WIN64 -IC:/Qt/6.1.3/Src/qtbase/src/plugins/sqldrivers/mysql/build-sqldrivers/odbc/QODBCDriverPlugin_autogen/include -IC:/Qt/6.1.3/Src/qtbase/src/plugins/sqldrivers/odbc -IC:/Qt/6.1.3/Src/qtbase/src/plugins/sqldrivers/mysql/build-sqldrivers/odbc -IC:/Qt/6.1.3/Src/qtbase/src/plugins/sqldrivers/mysql/build-sqldrivers/include -isystem C:/Qt/6.1.3/msvc2019_64/include/QtCore -isystem C:/Qt/6.1.3/msvc2019_64/include -isystem C:/Qt/6.1.3/msvc2019_64/mkspecs/win32-msvc -isystem C:/Qt/6.1.3/msvc2019_64/include/QtCore/6.1.3 -isystem C:/Qt/6.1.3/msvc2019_64/include/QtCore/6.1.3/QtCore -isystem C:/Qt/6.1.3/msvc2019_64/include/QtSql/6.1.3 -isystem C:/Qt/6.1.3/msvc2019_64/include/QtSql/6.1.3/QtSql -isystem C:/Qt/6.1.3/msvc2019_64/include/QtSql -DNDEBUG -O2 -Wall -Wextra -fno-exceptions -Zc:cplusplus -permissive- -utf-8 -pthread -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zc:externConstexpr -Zc:wchar_t -guard:cf -std=c++17 -MD -MT odbc/CMakeFiles/QODBCDriverPlugin.dir/qsql_odbc.cpp.obj -MF odbc\CMakeFiles\QODBCDriverPlugin.dir\qsql_odbc.cpp.obj.d -o odbc/CMakeFiles/QODBCDriverPlugin.dir/qsql_odbc.cpp.obj -c C:/Qt/6.1.3/Src/qtbase/src/plugins/sqldrivers/odbc/qsql_odbc.cpp
C~1.EXE: error: unrecognized debug output level 'uard:cf'
C__~1.EXE: error: unrecognized command line option '-Zc:cplusplus'
C~1.EXE: error: unrecognized command line option '-permissive-'; did you mean '-fpermissive'?
C__~1.EXE: error: unrecognized command line option '-Zc:rvalueCast'
C__~1.EXE: error: unrecognized command line option '-Zc:inline'; did you mean '-Winline'?
C__~1.EXE: error: unrecognized command line option '-Zc:strictStrings'
C__~1.EXE: error: unrecognized command line option '-Zc:throwingNew'
C__~1.EXE: error: unrecognized command line option '-Zc:referenceBinding'
C__~1.EXE: error: unrecognized command line option '-Zc:externConstexpr'
C__~1.EXE: error: unrecognized command line option '-Zc:wchar_t'
[10/13] Building CXX object mysql/CMakeFiles/QMYSQLDriverPlugin.dir/main.cpp.obj
FAILED: mysql/CMakeFiles/QMYSQLDriverPlugin.dir/main.cpp.obj
C:\PROGRA~1\MINGW-~1\X86_64~1.0-W\mingw64\bin\C__~1.EXE -DQMYSQLDriverPlugin_EXPORTS -DQT_CORE_LIB -DQT_DEPRECATED_WARNINGS -DQT_DEPRECATED_WARNINGS_SINCE=0x060000 -DQT_DISABLE_DEPRECATED_BEFORE=0x040800 -DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII -DQT_NO_DEBUG -DQT_NO_EXCEPTIONS -DQT_PLUGIN -DQT_SQL_LIB -DUNICODE -DWIN32 -DWIN64 -D_CRT_SECURE_NO_WARNINGS -D_ENABLE_EXTENDED_ALIGNED_STORAGE -D_UNICODE -D_WIN64 -IC:/Qt/6.1.3/Src/qtbase/src/plugins/sqldrivers/mysql/build-sqldrivers/mysql/QMYSQLDriverPlugin_autogen/include -IC:/Qt/6.1.3/Src/qtbase/src/plugins/sqldrivers/mysql -IC:/Qt/6.1.3/Src/qtbase/src/plugins/sqldrivers/mysql/build-sqldrivers/mysql -IC:/Qt/6.1.3/Src/qtbase/src/plugins/sqldrivers/mysql/build-sqldrivers/include -isystem "C:/Program Files/MySQL/MySQL Server 8.0/include" -isystem C:/Qt/6.1.3/msvc2019_64/include/QtCore -isystem C:/Qt/6.1.3/msvc2019_64/include -isystem C:/Qt/6.1.3/msvc2019_64/mkspecs/win32-msvc -isystem C:/Qt/6.1.3/msvc2019_64/include/QtCore/6.1.3 -isystem C:/Qt/6.1.3/msvc2019_64/include/QtCore/6.1.3/QtCore -isystem C:/Qt/6.1.3/msvc2019_64/include/QtSql/6.1.3 -isystem C:/Qt/6.1.3/msvc2019_64/include/QtSql/6.1.3/QtSql -isystem C:/Qt/6.1.3/msvc2019_64/include/QtSql -DNDEBUG -O2 -Wall -Wextra -fno-exceptions -Zc:cplusplus -permissive- -utf-8 -pthread -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zc:externConstexpr -Zc:wchar_t -guard:cf -std=c++17 -MD -MT mysql/CMakeFiles/QMYSQLDriverPlugin.dir/main.cpp.obj -MF mysql\CMakeFiles\QMYSQLDriverPlugin.dir\main.cpp.obj.d -o mysql/CMakeFiles/QMYSQLDriverPlugin.dir/main.cpp.obj -c C:/Qt/6.1.3/Src/qtbase/src/plugins/sqldrivers/mysql/main.cpp
C~1.EXE: error: unrecognized debug output level 'uard:cf'
C__~1.EXE: error: unrecognized command line option '-Zc:cplusplus'
C~1.EXE: error: unrecognized command line option '-permissive-'; did you mean '-fpermissive'?
C__~1.EXE: error: unrecognized command line option '-Zc:rvalueCast'
C__~1.EXE: error: unrecognized command line option '-Zc:inline'; did you mean '-Winline'?
C__~1.EXE: error: unrecognized command line option '-Zc:strictStrings'
C__~1.EXE: error: unrecognized command line option '-Zc:throwingNew'
C__~1.EXE: error: unrecognized command line option '-Zc:referenceBinding'
C__~1.EXE: error: unrecognized command line option '-Zc:externConstexpr'
C__~1.EXE: error: unrecognized command line option '-Zc:wchar_t'
ninja: build stopped: subcommand failed. -
@MartianXie said in Trying to build mysql driver in Qt 6.1.3 and MySQL 8.0:
C:\Qt\6.1.3\msvc2019_64
Why are you trying to build MSVC Qt with MinGW?
This is not going to work. Use same compiler which was used to build your Qt.