Mysql drivers built but qt can not find them
-
wrote on 15 Apr 2024, 14:31 last edited by
Hello, I have built the mysql drivers the other day and everything built without any errors
terminal logsboyankiovtorov@Boyans-MacBook-Air ~ % cd /Users/boyankiovtorov/Qt/6.7.0/macos/bin boyankiovtorov@Boyans-MacBook-Air bin % ./qt-cmake /Users/boyankiovtorov/Qt/6.7.0/Src/qtbase/src/plugins/sqldrivers -GNinja -DMySQL_INCLUDE_DIR=/usr/local/mysql-8.3.0-macos14-x86_64/include -DMySQL_LIBRARY=//usr/local/mysql-8.3.0-macos14-x86_64/lib/libmysqlclient.dylib -- Configuration summary has been written to /Users/boyankiovtorov/Qt/6.7.0/macos/bin/config.summary -- Configuring done (0.6s) -- Generating done (0.0s) -- Build files have been written to: /Users/boyankiovtorov/Qt/6.7.0/macos/bin boyankiovtorov@Boyans-MacBook-Air bin % cmake --build . [7/7] Linking CXX shared module plugins/sqldrivers/libqsqlite.dylib boyankiovtorov@Boyans-MacBook-Air bin % cmake ---install . CMake Error: Unknown argument ---install CMake Error: Run 'cmake --help' for all supported options. boyankiovtorov@Boyans-MacBook-Air bin % cmake --install . -- Install configuration: "RelWithDebInfo" -- Installing: /Users/boyankiovtorov/Qt/6.7.0/macos/lib/cmake/Qt6Sql/Qt6QMYSQLDriverPluginConfig.cmake -- Installing: /Users/boyankiovtorov/Qt/6.7.0/macos/lib/cmake/Qt6Sql/Qt6QMYSQLDriverPluginConfigVersion.cmake -- Installing: /Users/boyankiovtorov/Qt/6.7.0/macos/lib/cmake/Qt6Sql/Qt6QMYSQLDriverPluginConfigVersionImpl.cmake -- Installing: /Users/boyankiovtorov/Qt/6.7.0/macos/./plugins/sqldrivers/libqsqlmysql.dylib -- Installing: /Users/boyankiovtorov/Qt/6.7.0/macos/lib/cmake/Qt6Sql/Qt6QMYSQLDriverPluginTargets.cmake -- Installing: /Users/boyankiovtorov/Qt/6.7.0/macos/lib/cmake/Qt6Sql/Qt6QMYSQLDriverPluginTargets-relwithdebinfo.cmake -- Installing: /Users/boyankiovtorov/Qt/6.7.0/macos/./plugins/sqldrivers/libqsqlmysql.dylib.dSYM -- Installing: /Users/boyankiovtorov/Qt/6.7.0/macos/./plugins/sqldrivers/libqsqlmysql.dylib.dSYM/Contents -- Installing: /Users/boyankiovtorov/Qt/6.7.0/macos/./plugins/sqldrivers/libqsqlmysql.dylib.dSYM/Contents/Resources -- Installing: /Users/boyankiovtorov/Qt/6.7.0/macos/./plugins/sqldrivers/libqsqlmysql.dylib.dSYM/Contents/Resources/DWARF -- Installing: /Users/boyankiovtorov/Qt/6.7.0/macos/./plugins/sqldrivers/libqsqlmysql.dylib.dSYM/Contents/Resources/DWARF/qsqlmysql -- Installing: /Users/boyankiovtorov/Qt/6.7.0/macos/./plugins/sqldrivers/libqsqlmysql.dylib.dSYM/Contents/Info.plist -- Installing: /Users/boyankiovtorov/Qt/6.7.0/macos/lib/cmake/Qt6Sql/Qt6QMYSQLDriverPluginAdditionalTargetInfo.cmake -- Installing: /Users/boyankiovtorov/Qt/6.7.0/macos/lib/cmake/Qt6Sql/Qt6QSQLiteDriverPluginConfig.cmake -- Installing: /Users/boyankiovtorov/Qt/6.7.0/macos/lib/cmake/Qt6Sql/Qt6QSQLiteDriverPluginConfigVersion.cmake -- Installing: /Users/boyankiovtorov/Qt/6.7.0/macos/lib/cmake/Qt6Sql/Qt6QSQLiteDriverPluginConfigVersionImpl.cmake -- Installing: /Users/boyankiovtorov/Qt/6.7.0/macos/./plugins/sqldrivers/libqsqlite.dylib -- Installing: /Users/boyankiovtorov/Qt/6.7.0/macos/lib/cmake/Qt6Sql/Qt6QSQLiteDriverPluginTargets.cmake -- Installing: /Users/boyankiovtorov/Qt/6.7.0/macos/lib/cmake/Qt6Sql/Qt6QSQLiteDriverPluginTargets-relwithdebinfo.cmake -- Up-to-date: /Users/boyankiovtorov/Qt/6.7.0/macos/./plugins/sqldrivers/libqsqlite.dylib.dSYM -- Up-to-date: /Users/boyankiovtorov/Qt/6.7.0/macos/./plugins/sqldrivers/libqsqlite.dylib.dSYM/Contents -- Up-to-date: /Users/boyankiovtorov/Qt/6.7.0/macos/./plugins/sqldrivers/libqsqlite.dylib.dSYM/Contents/Resources -- Up-to-date: /Users/boyankiovtorov/Qt/6.7.0/macos/./plugins/sqldrivers/libqsqlite.dylib.dSYM/Contents/Resources/DWARF -- Installing: /Users/boyankiovtorov/Qt/6.7.0/macos/./plugins/sqldrivers/libqsqlite.dylib.dSYM/Contents/Resources/DWARF/qsqlite -- Installing: /Users/boyankiovtorov/Qt/6.7.0/macos/./plugins/sqldrivers/libqsqlite.dylib.dSYM/Contents/Info.plist -- Installing: /Users/boyankiovtorov/Qt/6.7.0/macos/lib/cmake/Qt6Sql/Qt6QSQLiteDriverPluginAdditionalTargetInfo.cmake
The .dylib was placed automatically with the other drivers. But still Qt can not find the driver
QSqlDatabase: QMYSQL driver not loaded QSqlDatabase: available drivers: QSQLITE QODBC QPSQL QMIMER
What am I doing wrong?
-
Hello, I have built the mysql drivers the other day and everything built without any errors
terminal logsboyankiovtorov@Boyans-MacBook-Air ~ % cd /Users/boyankiovtorov/Qt/6.7.0/macos/bin boyankiovtorov@Boyans-MacBook-Air bin % ./qt-cmake /Users/boyankiovtorov/Qt/6.7.0/Src/qtbase/src/plugins/sqldrivers -GNinja -DMySQL_INCLUDE_DIR=/usr/local/mysql-8.3.0-macos14-x86_64/include -DMySQL_LIBRARY=//usr/local/mysql-8.3.0-macos14-x86_64/lib/libmysqlclient.dylib -- Configuration summary has been written to /Users/boyankiovtorov/Qt/6.7.0/macos/bin/config.summary -- Configuring done (0.6s) -- Generating done (0.0s) -- Build files have been written to: /Users/boyankiovtorov/Qt/6.7.0/macos/bin boyankiovtorov@Boyans-MacBook-Air bin % cmake --build . [7/7] Linking CXX shared module plugins/sqldrivers/libqsqlite.dylib boyankiovtorov@Boyans-MacBook-Air bin % cmake ---install . CMake Error: Unknown argument ---install CMake Error: Run 'cmake --help' for all supported options. boyankiovtorov@Boyans-MacBook-Air bin % cmake --install . -- Install configuration: "RelWithDebInfo" -- Installing: /Users/boyankiovtorov/Qt/6.7.0/macos/lib/cmake/Qt6Sql/Qt6QMYSQLDriverPluginConfig.cmake -- Installing: /Users/boyankiovtorov/Qt/6.7.0/macos/lib/cmake/Qt6Sql/Qt6QMYSQLDriverPluginConfigVersion.cmake -- Installing: /Users/boyankiovtorov/Qt/6.7.0/macos/lib/cmake/Qt6Sql/Qt6QMYSQLDriverPluginConfigVersionImpl.cmake -- Installing: /Users/boyankiovtorov/Qt/6.7.0/macos/./plugins/sqldrivers/libqsqlmysql.dylib -- Installing: /Users/boyankiovtorov/Qt/6.7.0/macos/lib/cmake/Qt6Sql/Qt6QMYSQLDriverPluginTargets.cmake -- Installing: /Users/boyankiovtorov/Qt/6.7.0/macos/lib/cmake/Qt6Sql/Qt6QMYSQLDriverPluginTargets-relwithdebinfo.cmake -- Installing: /Users/boyankiovtorov/Qt/6.7.0/macos/./plugins/sqldrivers/libqsqlmysql.dylib.dSYM -- Installing: /Users/boyankiovtorov/Qt/6.7.0/macos/./plugins/sqldrivers/libqsqlmysql.dylib.dSYM/Contents -- Installing: /Users/boyankiovtorov/Qt/6.7.0/macos/./plugins/sqldrivers/libqsqlmysql.dylib.dSYM/Contents/Resources -- Installing: /Users/boyankiovtorov/Qt/6.7.0/macos/./plugins/sqldrivers/libqsqlmysql.dylib.dSYM/Contents/Resources/DWARF -- Installing: /Users/boyankiovtorov/Qt/6.7.0/macos/./plugins/sqldrivers/libqsqlmysql.dylib.dSYM/Contents/Resources/DWARF/qsqlmysql -- Installing: /Users/boyankiovtorov/Qt/6.7.0/macos/./plugins/sqldrivers/libqsqlmysql.dylib.dSYM/Contents/Info.plist -- Installing: /Users/boyankiovtorov/Qt/6.7.0/macos/lib/cmake/Qt6Sql/Qt6QMYSQLDriverPluginAdditionalTargetInfo.cmake -- Installing: /Users/boyankiovtorov/Qt/6.7.0/macos/lib/cmake/Qt6Sql/Qt6QSQLiteDriverPluginConfig.cmake -- Installing: /Users/boyankiovtorov/Qt/6.7.0/macos/lib/cmake/Qt6Sql/Qt6QSQLiteDriverPluginConfigVersion.cmake -- Installing: /Users/boyankiovtorov/Qt/6.7.0/macos/lib/cmake/Qt6Sql/Qt6QSQLiteDriverPluginConfigVersionImpl.cmake -- Installing: /Users/boyankiovtorov/Qt/6.7.0/macos/./plugins/sqldrivers/libqsqlite.dylib -- Installing: /Users/boyankiovtorov/Qt/6.7.0/macos/lib/cmake/Qt6Sql/Qt6QSQLiteDriverPluginTargets.cmake -- Installing: /Users/boyankiovtorov/Qt/6.7.0/macos/lib/cmake/Qt6Sql/Qt6QSQLiteDriverPluginTargets-relwithdebinfo.cmake -- Up-to-date: /Users/boyankiovtorov/Qt/6.7.0/macos/./plugins/sqldrivers/libqsqlite.dylib.dSYM -- Up-to-date: /Users/boyankiovtorov/Qt/6.7.0/macos/./plugins/sqldrivers/libqsqlite.dylib.dSYM/Contents -- Up-to-date: /Users/boyankiovtorov/Qt/6.7.0/macos/./plugins/sqldrivers/libqsqlite.dylib.dSYM/Contents/Resources -- Up-to-date: /Users/boyankiovtorov/Qt/6.7.0/macos/./plugins/sqldrivers/libqsqlite.dylib.dSYM/Contents/Resources/DWARF -- Installing: /Users/boyankiovtorov/Qt/6.7.0/macos/./plugins/sqldrivers/libqsqlite.dylib.dSYM/Contents/Resources/DWARF/qsqlite -- Installing: /Users/boyankiovtorov/Qt/6.7.0/macos/./plugins/sqldrivers/libqsqlite.dylib.dSYM/Contents/Info.plist -- Installing: /Users/boyankiovtorov/Qt/6.7.0/macos/lib/cmake/Qt6Sql/Qt6QSQLiteDriverPluginAdditionalTargetInfo.cmake
The .dylib was placed automatically with the other drivers. But still Qt can not find the driver
QSqlDatabase: QMYSQL driver not loaded QSqlDatabase: available drivers: QSQLITE QODBC QPSQL QMIMER
What am I doing wrong?
@DeadSo0ul As always in such situations and recommended here every day - start your app on the command line with QT_DEBUG_PLUGINS=1 env var set.
-
@DeadSo0ul As always in such situations and recommended here every day - start your app on the command line with QT_DEBUG_PLUGINS=1 env var set.
wrote on 16 Apr 2024, 15:43 last edited by DeadSo0ulHi @Christian-Ehrlicher
I ran Qt Creator usingexport QT_PLUGIN_PATH=/Users/boyankiovtorov/Qt/6.7.0/macos/plugins/sqldrivers
export QT_DEBUG_PLUGINS=1
and
open "QT Creator.app"
I did get an output of
qt.core.plugin.factoryloader: checking directory path "/Users/boyankiovtorov/Qt/6.7.0/macos/plugins/sqldrivers/platforms" ... qt.core.plugin.factoryloader: checking directory path "/Users/boyankiovtorov/Qt/6.7.0/macos/plugins/platforms" ... qt.core.plugin.factoryloader: looking at "/Users/boyankiovtorov/Qt/6.7.0/macos/plugins/platforms/libqoffscreen.dylib" qt.core.plugin.loader: Found metadata in lib /Users/boyankiovtorov/Qt/6.7.0/macos/plugins/platforms/libqoffscreen.dylib, metadata= { "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3", "MetaData": { "Keys": [ "offscreen" ] }, "archlevel": 0, "className": "QOffscreenIntegrationPlugin", "debug": false, "version": 395008 } qt.core.plugin.factoryloader: Got keys from plugin meta data QList("offscreen") qt.core.plugin.factoryloader: looking at "/Users/boyankiovtorov/Qt/6.7.0/macos/plugins/platforms/libqminimal.dylib" qt.core.plugin.loader: Found metadata in lib /Users/boyankiovtorov/Qt/6.7.0/macos/plugins/platforms/libqminimal.dylib, metadata= { "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3", "MetaData": { "Keys": [ "minimal" ] }, "archlevel": 0, "className": "QMinimalIntegrationPlugin", "debug": false, "version": 395008 } qt.core.plugin.factoryloader: Got keys from plugin meta data QList("minimal") qt.core.plugin.factoryloader: looking at "/Users/boyankiovtorov/Qt/6.7.0/macos/plugins/platforms/libqcocoa.dylib" qt.core.plugin.loader: Found metadata in lib /Users/boyankiovtorov/Qt/6.7.0/macos/plugins/platforms/libqcocoa.dylib, metadata= { "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3", "MetaData": { "Keys": [ "cocoa" ] }, "archlevel": 0, "className": "QCocoaIntegrationPlugin", "debug": false, "version": 395008 } qt.core.plugin.factoryloader: Got keys from plugin meta data QList("cocoa") qt.core.plugin.factoryloader: checking directory path "/Users/boyankiovtorov/Desktop/school-project-assignment-insight/build/Qt_6_7_0_for_macOS-Debug/Insight.app/Contents/MacOS/platforms" ... qt.core.library: "/Users/boyankiovtorov/Qt/6.7.0/macos/plugins/platforms/libqcocoa.dylib" loaded library qt.core.plugin.factoryloader: checking directory path "/Users/boyankiovtorov/Qt/6.7.0/macos/plugins/sqldrivers/platformthemes" ... qt.core.plugin.factoryloader: checking directory path "/Users/boyankiovtorov/Qt/6.7.0/macos/plugins/platformthemes" ... qt.core.plugin.factoryloader: checking directory path "/Users/boyankiovtorov/Desktop/school-project-assignment-insight/build/Qt_6_7_0_for_macOS-Debug/Insight.app/Contents/MacOS/platformthemes" ... qt.core.plugin.factoryloader: checking directory path "/Users/boyankiovtorov/Qt/6.7.0/macos/plugins/sqldrivers/styles" ... qt.core.plugin.factoryloader: checking directory path "/Users/boyankiovtorov/Qt/6.7.0/macos/plugins/styles" ... qt.core.plugin.factoryloader: looking at "/Users/boyankiovtorov/Qt/6.7.0/macos/plugins/styles/libqmacstyle.dylib" qt.core.plugin.loader: Found metadata in lib /Users/boyankiovtorov/Qt/6.7.0/macos/plugins/styles/libqmacstyle.dylib, metadata= { "IID": "org.qt-project.Qt.QStyleFactoryInterface", "MetaData": { "Keys": [ "macOS" ] }, "archlevel": 0, "className": "QMacStylePlugin", "debug": false, "version": 395008 } qt.core.plugin.factoryloader: Got keys from plugin meta data QList("macos") qt.core.plugin.factoryloader: checking directory path "/Users/boyankiovtorov/Desktop/school-project-assignment-insight/build/Qt_6_7_0_for_macOS-Debug/Insight.app/Contents/MacOS/styles" ... qt.core.library: "/Users/boyankiovtorov/Qt/6.7.0/macos/plugins/styles/libqmacstyle.dylib" loaded library qt.core.plugin.factoryloader: checking directory path "/Users/boyankiovtorov/Qt/6.7.0/macos/plugins/sqldrivers/iconengines" ... qt.core.plugin.factoryloader: checking directory path "/Users/boyankiovtorov/Qt/6.7.0/macos/plugins/iconengines" ... qt.core.plugin.factoryloader: looking at "/Users/boyankiovtorov/Qt/6.7.0/macos/plugins/iconengines/libqsvgicon.dylib" qt.core.plugin.loader: Found metadata in lib /Users/boyankiovtorov/Qt/6.7.0/macos/plugins/iconengines/libqsvgicon.dylib, metadata= { "IID": "org.qt-project.Qt.QIconEngineFactoryInterface", "MetaData": { "Keys": [ "svg", "svgz", "svg.gz" ] }, "archlevel": 0, "className": "QSvgIconPlugin", "debug": false, "version": 395008 } qt.core.plugin.factoryloader: Got keys from plugin meta data QList("svg", "svgz", "svg.gz") qt.core.plugin.factoryloader: checking directory path "/Users/boyankiovtorov/Desktop/school-project-assignment-insight/build/Qt_6_7_0_for_macOS-Debug/Insight.app/Contents/MacOS/iconengines" ... qt.core.plugin.factoryloader: checking directory path "/Users/boyankiovtorov/Qt/6.7.0/macos/plugins/sqldrivers/imageformats" ... qt.core.plugin.factoryloader: checking directory path "/Users/boyankiovtorov/Qt/6.7.0/macos/plugins/imageformats" ... qt.core.plugin.factoryloader: looking at "/Users/boyankiovtorov/Qt/6.7.0/macos/plugins/imageformats/libqgif.dylib" qt.core.plugin.loader: Found metadata in lib /Users/boyankiovtorov/Qt/6.7.0/macos/plugins/imageformats/libqgif.dylib, metadata= { "IID": "org.qt-project.Qt.QImageIOHandlerFactoryInterface", "MetaData": { "Keys": [ "gif" ], "MimeTypes": [ "image/gif" ] }, "archlevel": 0, "className": "QGifPlugin", "debug": false, "version": 395008 } qt.core.plugin.factoryloader: Got keys from plugin meta data QList("gif") qt.core.plugin.factoryloader: looking at "/Users/boyankiovtorov/Qt/6.7.0/macos/plugins/imageformats/libqico.dylib" qt.core.plugin.loader: Found metadata in lib /Users/boyankiovtorov/Qt/6.7.0/macos/plugins/imageformats/libqico.dylib, metadata= { "IID": "org.qt-project.Qt.QImageIOHandlerFactoryInterface", "MetaData": { "Keys": [ "ico", "cur" ], "MimeTypes": [ "image/vnd.microsoft.icon", "image/vnd.microsoft.icon" ] }, "archlevel": 0, "className": "QICOPlugin", "debug": false, "version": 395008 } qt.core.plugin.factoryloader: Got keys from plugin meta data QList("ico", "cur") qt.core.plugin.factoryloader: looking at "/Users/boyankiovtorov/Qt/6.7.0/macos/plugins/imageformats/libqjpeg.dylib" qt.core.plugin.loader: Found metadata in lib /Users/boyankiovtorov/Qt/6.7.0/macos/plugins/imageformats/libqjpeg.dylib, metadata= { "IID": "org.qt-project.Qt.QImageIOHandlerFactoryInterface", "MetaData": { "Keys": [ "jpg", "jpeg" ], "MimeTypes": [ "image/jpeg", "image/jpeg" ] }, "archlevel": 0, "className": "QJpegPlugin", "debug": false, "version": 395008 } qt.core.plugin.factoryloader: Got keys from plugin meta data QList("jpg", "jpeg") qt.core.plugin.factoryloader: looking at "/Users/boyankiovtorov/Qt/6.7.0/macos/plugins/imageformats/libqsvg.dylib" qt.core.plugin.loader: Found metadata in lib /Users/boyankiovtorov/Qt/6.7.0/macos/plugins/imageformats/libqsvg.dylib, metadata= { "IID": "org.qt-project.Qt.QImageIOHandlerFactoryInterface", "MetaData": { "Keys": [ "svg", "svgz" ], "MimeTypes": [ "image/svg+xml", "image/svg+xml-compressed" ] }, "archlevel": 0, "className": "QSvgPlugin", "debug": false, "version": 395008 } qt.core.plugin.factoryloader: Got keys from plugin meta data QList("svg", "svgz") qt.core.plugin.factoryloader: checking directory path "/Users/boyankiovtorov/Desktop/school-project-assignment-insight/build/Qt_6_7_0_for_macOS-Debug/Insight.app/Contents/MacOS/imageformats" ... qt.core.library: "/Users/boyankiovtorov/Qt/6.7.0/macos/plugins/imageformats/libqgif.dylib" loaded library qt.core.library: "/Users/boyankiovtorov/Qt/6.7.0/macos/plugins/imageformats/libqico.dylib" loaded library qt.core.library: "/Users/boyankiovtorov/Qt/6.7.0/macos/plugins/imageformats/libqjpeg.dylib" loaded library qt.core.library: "/Users/boyankiovtorov/Qt/6.7.0/macos/plugins/imageformats/libqsvg.dylib" loaded library qt.core.plugin.factoryloader: checking directory path "/Users/boyankiovtorov/Qt/6.7.0/macos/plugins/sqldrivers/sqldrivers" ... qt.core.plugin.factoryloader: checking directory path "/Users/boyankiovtorov/Qt/6.7.0/macos/plugins/sqldrivers" ... qt.core.plugin.factoryloader: looking at "/Users/boyankiovtorov/Qt/6.7.0/macos/plugins/sqldrivers/libqsqlite.dylib" qt.core.plugin.loader: Found metadata in lib /Users/boyankiovtorov/Qt/6.7.0/macos/plugins/sqldrivers/libqsqlite.dylib, metadata= { "IID": "org.qt-project.Qt.QSqlDriverFactoryInterface", "MetaData": { "Keys": [ "QSQLITE" ] }, "archlevel": 0, "className": "QSQLiteDriverPlugin", "debug": false, "version": 395008 } qt.core.plugin.factoryloader: Got keys from plugin meta data QList("QSQLITE") qt.core.plugin.factoryloader: looking at "/Users/boyankiovtorov/Qt/6.7.0/macos/plugins/sqldrivers/libqsqlmysql.dylib" qt.core.plugin.loader: Failed to find metadata in lib /Users/boyankiovtorov/Qt/6.7.0/macos/plugins/sqldrivers/libqsqlmysql.dylib: '/Users/boyankiovtorov/Qt/6.7.0/macos/plugins/sqldrivers/libqsqlmysql.dylib' is not a valid Mach-O binary (wrong architecture) qt.core.plugin.factoryloader: "Failed to extract plugin meta data from '/Users/boyankiovtorov/Qt/6.7.0/macos/plugins/sqldrivers/libqsqlmysql.dylib': '/Users/boyankiovtorov/Qt/6.7.0/macos/plugins/sqldrivers/libqsqlmysql.dylib' is not a valid Mach-O binary (wrong architecture)" not a plugin qt.core.plugin.factoryloader: looking at "/Users/boyankiovtorov/Qt/6.7.0/macos/plugins/sqldrivers/libqsqlodbc.dylib" qt.core.plugin.loader: Found metadata in lib /Users/boyankiovtorov/Qt/6.7.0/macos/plugins/sqldrivers/libqsqlodbc.dylib, metadata= { "IID": "org.qt-project.Qt.QSqlDriverFactoryInterface", "MetaData": { "Keys": [ "QODBC" ] }, "archlevel": 0, "className": "QODBCDriverPlugin", "debug": false, "version": 395008 } qt.core.plugin.factoryloader: Got keys from plugin meta data QList("QODBC") qt.core.plugin.factoryloader: looking at "/Users/boyankiovtorov/Qt/6.7.0/macos/plugins/sqldrivers/libqsqlpsql.dylib" qt.core.plugin.loader: Found metadata in lib /Users/boyankiovtorov/Qt/6.7.0/macos/plugins/sqldrivers/libqsqlpsql.dylib, metadata= { "IID": "org.qt-project.Qt.QSqlDriverFactoryInterface", "MetaData": { "Keys": [ "QPSQL" ] }, "archlevel": 0, "className": "QPSQLDriverPlugin", "debug": false, "version": 395008 } qt.core.plugin.factoryloader: Got keys from plugin meta data QList("QPSQL") qt.core.plugin.factoryloader: looking at "/Users/boyankiovtorov/Qt/6.7.0/macos/plugins/sqldrivers/libqsqlmimer.dylib" qt.core.plugin.loader: Found metadata in lib /Users/boyankiovtorov/Qt/6.7.0/macos/plugins/sqldrivers/libqsqlmimer.dylib, metadata= { "IID": "org.qt-project.Qt.QSqlDriverFactoryInterface", "MetaData": { "Keys": [ "QMIMER" ] }, "archlevel": 0, "className": "QMimerSQLDriverPlugin", "debug": false, "version": 395008 } qt.core.plugin.factoryloader: Got keys from plugin meta data QList("QMIMER") qt.core.plugin.factoryloader: checking directory path "/Users/boyankiovtorov/Desktop/school-project-assignment-insight/build/Qt_6_7_0_for_macOS-Debug/Insight.app/Contents/MacOS/sqldrivers" ... QSqlDatabase: QMYSQL driver not loaded QSqlDatabase: available drivers: QSQLITE QODBC QPSQL QMIMER Database failed to open "Driver not loaded Driver not loaded" qt.core.plugin.factoryloader: checking directory path "/Users/boyankiovtorov/Qt/6.7.0/macos/plugins/sqldrivers/accessible" ... qt.core.plugin.factoryloader: checking directory path "/Users/boyankiovtorov/Qt/6.7.0/macos/plugins/accessible" ... qt.core.plugin.factoryloader: checking directory path "/Users/boyankiovtorov/Desktop/school-project-assignment-insight/build/Qt_6_7_0_for_macOS-Debug/Insight.app/Contents/MacOS/accessible" ... qt.qpa.fonts: Populating font family aliases took 158 ms. Replace uses of missing font family "Segoe UI" with one that exists to avoid this cost. QCssParser::parseHexColor: Unknown color name '#ffff' QSqlQuery::prepare: database not open QSqlError("", "Driver not loaded", "Driver not loaded") "" QList() "/Users/boyankiovtorov/Qt/6.7.0/macos/plugins/imageformats/libqgif.dylib" unloaded library (faked) "/Users/boyankiovtorov/Qt/6.7.0/macos/plugins/imageformats/libqico.dylib" unloaded library (faked) "/Users/boyankiovtorov/Qt/6.7.0/macos/plugins/imageformats/libqjpeg.dylib" unloaded library (faked) "/Users/boyankiovtorov/Qt/6.7.0/macos/plugins/imageformats/libqsvg.dylib" unloaded library (faked) "/Users/boyankiovtorov/Qt/6.7.0/macos/plugins/platforms/libqcocoa.dylib" unloaded library (faked) "/Users/boyankiovtorov/Qt/6.7.0/macos/plugins/styles/libqmacstyle.dylib" unloaded library (faked)
The driver I have problem is QMYSQL
qt.core.plugin.factoryloader: looking at "/Users/boyankiovtorov/Qt/6.7.0/macos/plugins/sqldrivers/libqsqlmysql.dylib" qt.core.plugin.loader: Failed to find metadata in lib /Users/boyankiovtorov/Qt/6.7.0/macos/plugins/sqldrivers/libqsqlmysql.dylib: '/Users/boyankiovtorov/Qt/6.7.0/macos/plugins/sqldrivers/libqsqlmysql.dylib' is not a valid Mach-O binary (wrong architecture) qt.core.plugin.factoryloader: "Failed to extract plugin meta data from '/Users/boyankiovtorov/Qt/6.7.0/macos/plugins/sqldrivers/libqsqlmysql.dylib': '/Users/boyankiovtorov/Qt/6.7.0/macos/plugins/sqldrivers/libqsqlmysql.dylib' is not a valid Mach-O binary (wrong architecture)" not a plugin
-
Hi @Christian-Ehrlicher
I ran Qt Creator usingexport QT_PLUGIN_PATH=/Users/boyankiovtorov/Qt/6.7.0/macos/plugins/sqldrivers
export QT_DEBUG_PLUGINS=1
and
open "QT Creator.app"
I did get an output of
qt.core.plugin.factoryloader: checking directory path "/Users/boyankiovtorov/Qt/6.7.0/macos/plugins/sqldrivers/platforms" ... qt.core.plugin.factoryloader: checking directory path "/Users/boyankiovtorov/Qt/6.7.0/macos/plugins/platforms" ... qt.core.plugin.factoryloader: looking at "/Users/boyankiovtorov/Qt/6.7.0/macos/plugins/platforms/libqoffscreen.dylib" qt.core.plugin.loader: Found metadata in lib /Users/boyankiovtorov/Qt/6.7.0/macos/plugins/platforms/libqoffscreen.dylib, metadata= { "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3", "MetaData": { "Keys": [ "offscreen" ] }, "archlevel": 0, "className": "QOffscreenIntegrationPlugin", "debug": false, "version": 395008 } qt.core.plugin.factoryloader: Got keys from plugin meta data QList("offscreen") qt.core.plugin.factoryloader: looking at "/Users/boyankiovtorov/Qt/6.7.0/macos/plugins/platforms/libqminimal.dylib" qt.core.plugin.loader: Found metadata in lib /Users/boyankiovtorov/Qt/6.7.0/macos/plugins/platforms/libqminimal.dylib, metadata= { "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3", "MetaData": { "Keys": [ "minimal" ] }, "archlevel": 0, "className": "QMinimalIntegrationPlugin", "debug": false, "version": 395008 } qt.core.plugin.factoryloader: Got keys from plugin meta data QList("minimal") qt.core.plugin.factoryloader: looking at "/Users/boyankiovtorov/Qt/6.7.0/macos/plugins/platforms/libqcocoa.dylib" qt.core.plugin.loader: Found metadata in lib /Users/boyankiovtorov/Qt/6.7.0/macos/plugins/platforms/libqcocoa.dylib, metadata= { "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3", "MetaData": { "Keys": [ "cocoa" ] }, "archlevel": 0, "className": "QCocoaIntegrationPlugin", "debug": false, "version": 395008 } qt.core.plugin.factoryloader: Got keys from plugin meta data QList("cocoa") qt.core.plugin.factoryloader: checking directory path "/Users/boyankiovtorov/Desktop/school-project-assignment-insight/build/Qt_6_7_0_for_macOS-Debug/Insight.app/Contents/MacOS/platforms" ... qt.core.library: "/Users/boyankiovtorov/Qt/6.7.0/macos/plugins/platforms/libqcocoa.dylib" loaded library qt.core.plugin.factoryloader: checking directory path "/Users/boyankiovtorov/Qt/6.7.0/macos/plugins/sqldrivers/platformthemes" ... qt.core.plugin.factoryloader: checking directory path "/Users/boyankiovtorov/Qt/6.7.0/macos/plugins/platformthemes" ... qt.core.plugin.factoryloader: checking directory path "/Users/boyankiovtorov/Desktop/school-project-assignment-insight/build/Qt_6_7_0_for_macOS-Debug/Insight.app/Contents/MacOS/platformthemes" ... qt.core.plugin.factoryloader: checking directory path "/Users/boyankiovtorov/Qt/6.7.0/macos/plugins/sqldrivers/styles" ... qt.core.plugin.factoryloader: checking directory path "/Users/boyankiovtorov/Qt/6.7.0/macos/plugins/styles" ... qt.core.plugin.factoryloader: looking at "/Users/boyankiovtorov/Qt/6.7.0/macos/plugins/styles/libqmacstyle.dylib" qt.core.plugin.loader: Found metadata in lib /Users/boyankiovtorov/Qt/6.7.0/macos/plugins/styles/libqmacstyle.dylib, metadata= { "IID": "org.qt-project.Qt.QStyleFactoryInterface", "MetaData": { "Keys": [ "macOS" ] }, "archlevel": 0, "className": "QMacStylePlugin", "debug": false, "version": 395008 } qt.core.plugin.factoryloader: Got keys from plugin meta data QList("macos") qt.core.plugin.factoryloader: checking directory path "/Users/boyankiovtorov/Desktop/school-project-assignment-insight/build/Qt_6_7_0_for_macOS-Debug/Insight.app/Contents/MacOS/styles" ... qt.core.library: "/Users/boyankiovtorov/Qt/6.7.0/macos/plugins/styles/libqmacstyle.dylib" loaded library qt.core.plugin.factoryloader: checking directory path "/Users/boyankiovtorov/Qt/6.7.0/macos/plugins/sqldrivers/iconengines" ... qt.core.plugin.factoryloader: checking directory path "/Users/boyankiovtorov/Qt/6.7.0/macos/plugins/iconengines" ... qt.core.plugin.factoryloader: looking at "/Users/boyankiovtorov/Qt/6.7.0/macos/plugins/iconengines/libqsvgicon.dylib" qt.core.plugin.loader: Found metadata in lib /Users/boyankiovtorov/Qt/6.7.0/macos/plugins/iconengines/libqsvgicon.dylib, metadata= { "IID": "org.qt-project.Qt.QIconEngineFactoryInterface", "MetaData": { "Keys": [ "svg", "svgz", "svg.gz" ] }, "archlevel": 0, "className": "QSvgIconPlugin", "debug": false, "version": 395008 } qt.core.plugin.factoryloader: Got keys from plugin meta data QList("svg", "svgz", "svg.gz") qt.core.plugin.factoryloader: checking directory path "/Users/boyankiovtorov/Desktop/school-project-assignment-insight/build/Qt_6_7_0_for_macOS-Debug/Insight.app/Contents/MacOS/iconengines" ... qt.core.plugin.factoryloader: checking directory path "/Users/boyankiovtorov/Qt/6.7.0/macos/plugins/sqldrivers/imageformats" ... qt.core.plugin.factoryloader: checking directory path "/Users/boyankiovtorov/Qt/6.7.0/macos/plugins/imageformats" ... qt.core.plugin.factoryloader: looking at "/Users/boyankiovtorov/Qt/6.7.0/macos/plugins/imageformats/libqgif.dylib" qt.core.plugin.loader: Found metadata in lib /Users/boyankiovtorov/Qt/6.7.0/macos/plugins/imageformats/libqgif.dylib, metadata= { "IID": "org.qt-project.Qt.QImageIOHandlerFactoryInterface", "MetaData": { "Keys": [ "gif" ], "MimeTypes": [ "image/gif" ] }, "archlevel": 0, "className": "QGifPlugin", "debug": false, "version": 395008 } qt.core.plugin.factoryloader: Got keys from plugin meta data QList("gif") qt.core.plugin.factoryloader: looking at "/Users/boyankiovtorov/Qt/6.7.0/macos/plugins/imageformats/libqico.dylib" qt.core.plugin.loader: Found metadata in lib /Users/boyankiovtorov/Qt/6.7.0/macos/plugins/imageformats/libqico.dylib, metadata= { "IID": "org.qt-project.Qt.QImageIOHandlerFactoryInterface", "MetaData": { "Keys": [ "ico", "cur" ], "MimeTypes": [ "image/vnd.microsoft.icon", "image/vnd.microsoft.icon" ] }, "archlevel": 0, "className": "QICOPlugin", "debug": false, "version": 395008 } qt.core.plugin.factoryloader: Got keys from plugin meta data QList("ico", "cur") qt.core.plugin.factoryloader: looking at "/Users/boyankiovtorov/Qt/6.7.0/macos/plugins/imageformats/libqjpeg.dylib" qt.core.plugin.loader: Found metadata in lib /Users/boyankiovtorov/Qt/6.7.0/macos/plugins/imageformats/libqjpeg.dylib, metadata= { "IID": "org.qt-project.Qt.QImageIOHandlerFactoryInterface", "MetaData": { "Keys": [ "jpg", "jpeg" ], "MimeTypes": [ "image/jpeg", "image/jpeg" ] }, "archlevel": 0, "className": "QJpegPlugin", "debug": false, "version": 395008 } qt.core.plugin.factoryloader: Got keys from plugin meta data QList("jpg", "jpeg") qt.core.plugin.factoryloader: looking at "/Users/boyankiovtorov/Qt/6.7.0/macos/plugins/imageformats/libqsvg.dylib" qt.core.plugin.loader: Found metadata in lib /Users/boyankiovtorov/Qt/6.7.0/macos/plugins/imageformats/libqsvg.dylib, metadata= { "IID": "org.qt-project.Qt.QImageIOHandlerFactoryInterface", "MetaData": { "Keys": [ "svg", "svgz" ], "MimeTypes": [ "image/svg+xml", "image/svg+xml-compressed" ] }, "archlevel": 0, "className": "QSvgPlugin", "debug": false, "version": 395008 } qt.core.plugin.factoryloader: Got keys from plugin meta data QList("svg", "svgz") qt.core.plugin.factoryloader: checking directory path "/Users/boyankiovtorov/Desktop/school-project-assignment-insight/build/Qt_6_7_0_for_macOS-Debug/Insight.app/Contents/MacOS/imageformats" ... qt.core.library: "/Users/boyankiovtorov/Qt/6.7.0/macos/plugins/imageformats/libqgif.dylib" loaded library qt.core.library: "/Users/boyankiovtorov/Qt/6.7.0/macos/plugins/imageformats/libqico.dylib" loaded library qt.core.library: "/Users/boyankiovtorov/Qt/6.7.0/macos/plugins/imageformats/libqjpeg.dylib" loaded library qt.core.library: "/Users/boyankiovtorov/Qt/6.7.0/macos/plugins/imageformats/libqsvg.dylib" loaded library qt.core.plugin.factoryloader: checking directory path "/Users/boyankiovtorov/Qt/6.7.0/macos/plugins/sqldrivers/sqldrivers" ... qt.core.plugin.factoryloader: checking directory path "/Users/boyankiovtorov/Qt/6.7.0/macos/plugins/sqldrivers" ... qt.core.plugin.factoryloader: looking at "/Users/boyankiovtorov/Qt/6.7.0/macos/plugins/sqldrivers/libqsqlite.dylib" qt.core.plugin.loader: Found metadata in lib /Users/boyankiovtorov/Qt/6.7.0/macos/plugins/sqldrivers/libqsqlite.dylib, metadata= { "IID": "org.qt-project.Qt.QSqlDriverFactoryInterface", "MetaData": { "Keys": [ "QSQLITE" ] }, "archlevel": 0, "className": "QSQLiteDriverPlugin", "debug": false, "version": 395008 } qt.core.plugin.factoryloader: Got keys from plugin meta data QList("QSQLITE") qt.core.plugin.factoryloader: looking at "/Users/boyankiovtorov/Qt/6.7.0/macos/plugins/sqldrivers/libqsqlmysql.dylib" qt.core.plugin.loader: Failed to find metadata in lib /Users/boyankiovtorov/Qt/6.7.0/macos/plugins/sqldrivers/libqsqlmysql.dylib: '/Users/boyankiovtorov/Qt/6.7.0/macos/plugins/sqldrivers/libqsqlmysql.dylib' is not a valid Mach-O binary (wrong architecture) qt.core.plugin.factoryloader: "Failed to extract plugin meta data from '/Users/boyankiovtorov/Qt/6.7.0/macos/plugins/sqldrivers/libqsqlmysql.dylib': '/Users/boyankiovtorov/Qt/6.7.0/macos/plugins/sqldrivers/libqsqlmysql.dylib' is not a valid Mach-O binary (wrong architecture)" not a plugin qt.core.plugin.factoryloader: looking at "/Users/boyankiovtorov/Qt/6.7.0/macos/plugins/sqldrivers/libqsqlodbc.dylib" qt.core.plugin.loader: Found metadata in lib /Users/boyankiovtorov/Qt/6.7.0/macos/plugins/sqldrivers/libqsqlodbc.dylib, metadata= { "IID": "org.qt-project.Qt.QSqlDriverFactoryInterface", "MetaData": { "Keys": [ "QODBC" ] }, "archlevel": 0, "className": "QODBCDriverPlugin", "debug": false, "version": 395008 } qt.core.plugin.factoryloader: Got keys from plugin meta data QList("QODBC") qt.core.plugin.factoryloader: looking at "/Users/boyankiovtorov/Qt/6.7.0/macos/plugins/sqldrivers/libqsqlpsql.dylib" qt.core.plugin.loader: Found metadata in lib /Users/boyankiovtorov/Qt/6.7.0/macos/plugins/sqldrivers/libqsqlpsql.dylib, metadata= { "IID": "org.qt-project.Qt.QSqlDriverFactoryInterface", "MetaData": { "Keys": [ "QPSQL" ] }, "archlevel": 0, "className": "QPSQLDriverPlugin", "debug": false, "version": 395008 } qt.core.plugin.factoryloader: Got keys from plugin meta data QList("QPSQL") qt.core.plugin.factoryloader: looking at "/Users/boyankiovtorov/Qt/6.7.0/macos/plugins/sqldrivers/libqsqlmimer.dylib" qt.core.plugin.loader: Found metadata in lib /Users/boyankiovtorov/Qt/6.7.0/macos/plugins/sqldrivers/libqsqlmimer.dylib, metadata= { "IID": "org.qt-project.Qt.QSqlDriverFactoryInterface", "MetaData": { "Keys": [ "QMIMER" ] }, "archlevel": 0, "className": "QMimerSQLDriverPlugin", "debug": false, "version": 395008 } qt.core.plugin.factoryloader: Got keys from plugin meta data QList("QMIMER") qt.core.plugin.factoryloader: checking directory path "/Users/boyankiovtorov/Desktop/school-project-assignment-insight/build/Qt_6_7_0_for_macOS-Debug/Insight.app/Contents/MacOS/sqldrivers" ... QSqlDatabase: QMYSQL driver not loaded QSqlDatabase: available drivers: QSQLITE QODBC QPSQL QMIMER Database failed to open "Driver not loaded Driver not loaded" qt.core.plugin.factoryloader: checking directory path "/Users/boyankiovtorov/Qt/6.7.0/macos/plugins/sqldrivers/accessible" ... qt.core.plugin.factoryloader: checking directory path "/Users/boyankiovtorov/Qt/6.7.0/macos/plugins/accessible" ... qt.core.plugin.factoryloader: checking directory path "/Users/boyankiovtorov/Desktop/school-project-assignment-insight/build/Qt_6_7_0_for_macOS-Debug/Insight.app/Contents/MacOS/accessible" ... qt.qpa.fonts: Populating font family aliases took 158 ms. Replace uses of missing font family "Segoe UI" with one that exists to avoid this cost. QCssParser::parseHexColor: Unknown color name '#ffff' QSqlQuery::prepare: database not open QSqlError("", "Driver not loaded", "Driver not loaded") "" QList() "/Users/boyankiovtorov/Qt/6.7.0/macos/plugins/imageformats/libqgif.dylib" unloaded library (faked) "/Users/boyankiovtorov/Qt/6.7.0/macos/plugins/imageformats/libqico.dylib" unloaded library (faked) "/Users/boyankiovtorov/Qt/6.7.0/macos/plugins/imageformats/libqjpeg.dylib" unloaded library (faked) "/Users/boyankiovtorov/Qt/6.7.0/macos/plugins/imageformats/libqsvg.dylib" unloaded library (faked) "/Users/boyankiovtorov/Qt/6.7.0/macos/plugins/platforms/libqcocoa.dylib" unloaded library (faked) "/Users/boyankiovtorov/Qt/6.7.0/macos/plugins/styles/libqmacstyle.dylib" unloaded library (faked)
The driver I have problem is QMYSQL
qt.core.plugin.factoryloader: looking at "/Users/boyankiovtorov/Qt/6.7.0/macos/plugins/sqldrivers/libqsqlmysql.dylib" qt.core.plugin.loader: Failed to find metadata in lib /Users/boyankiovtorov/Qt/6.7.0/macos/plugins/sqldrivers/libqsqlmysql.dylib: '/Users/boyankiovtorov/Qt/6.7.0/macos/plugins/sqldrivers/libqsqlmysql.dylib' is not a valid Mach-O binary (wrong architecture) qt.core.plugin.factoryloader: "Failed to extract plugin meta data from '/Users/boyankiovtorov/Qt/6.7.0/macos/plugins/sqldrivers/libqsqlmysql.dylib': '/Users/boyankiovtorov/Qt/6.7.0/macos/plugins/sqldrivers/libqsqlmysql.dylib' is not a valid Mach-O binary (wrong architecture)" not a plugin
@DeadSo0ul said in Mysql drivers built but qt can not find them:
qt.core.plugin.factoryloader: "Failed to extract plugin meta data from '/Users/boyankiovtorov/Qt/6.7.0/macos/plugins/sqldrivers/libqsqlmysql.dylib': '/Users/boyankiovtorov/Qt/6.7.0/macos/plugins/sqldrivers/libqsqlmysql.dylib' is not a valid Mach-O binary (wrong architecture)"
Isn't this obvious enough?
-
@DeadSo0ul said in Mysql drivers built but qt can not find them:
qt.core.plugin.factoryloader: "Failed to extract plugin meta data from '/Users/boyankiovtorov/Qt/6.7.0/macos/plugins/sqldrivers/libqsqlmysql.dylib': '/Users/boyankiovtorov/Qt/6.7.0/macos/plugins/sqldrivers/libqsqlmysql.dylib' is not a valid Mach-O binary (wrong architecture)"
Isn't this obvious enough?
wrote on 16 Apr 2024, 19:17 last edited by DeadSo0ul@Christian-Ehrlicher It is, but the problem is that when I firstly tried to build for my architecture I got the error
ld: warning: ignoring file '/usr/local/mysql-8.3.0-macos14-arm64/lib/libmysqlclient.23.dylib': found architecture 'arm64', required architecture 'x86_64'
and from there my build crashed for arm64
Here is the command I used if it helps somehow
./qt-cmake /Users/boyankiovtorov/Qt/6.7.0/Src/qtbase/src/plugins/sqldrivers -GNinja -DMySQL_INCLUDE_DIR=/usr/local/mysql-8.3.0-macos14-arm64/include -DMySQL_LIBRARY=/usr/local/mysql-8.3.0-macos14-arm64/lib/libmysqlclient.dylib
-
@Christian-Ehrlicher It is, but the problem is that when I firstly tried to build for my architecture I got the error
ld: warning: ignoring file '/usr/local/mysql-8.3.0-macos14-arm64/lib/libmysqlclient.23.dylib': found architecture 'arm64', required architecture 'x86_64'
and from there my build crashed for arm64
Here is the command I used if it helps somehow
./qt-cmake /Users/boyankiovtorov/Qt/6.7.0/Src/qtbase/src/plugins/sqldrivers -GNinja -DMySQL_INCLUDE_DIR=/usr/local/mysql-8.3.0-macos14-arm64/include -DMySQL_LIBRARY=/usr/local/mysql-8.3.0-macos14-arm64/lib/libmysqlclient.dylib
@DeadSo0ul hi,
Do you have an Intel or an M series machine ?
You need to either have MySQL for x86_64 or build Qt for arm64.
-
wrote on 16 Apr 2024, 19:42 last edited by
Hi @SGaist don't worry about Qt's architectures, I think at least from 6.2 the online version installs both of them, e.g.
file ~/Qt/6.7.0/macos/lib/QtCore.framework/QtCore /Users/henry/Qt/6.7.0/macos/lib/QtCore.framework/QtCore: Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit dynamically linked shared library x86_64] [arm64] /Users/henry/Qt/6.7.0/macos/lib/QtCore.framework/QtCore (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64 /Users/henry/Qt/6.7.0/macos/lib/QtCore.framework/QtCore (for architecture arm64): Mach-O 64-bit dynamically linked shared library arm64
However homebrew (where you usually get the MySql stuff) only gives you one architecture, so you have to check with file
-
@DeadSo0ul hi,
Do you have an Intel or an M series machine ?
You need to either have MySQL for x86_64 or build Qt for arm64.
-
Hi @SGaist don't worry about Qt's architectures, I think at least from 6.2 the online version installs both of them, e.g.
file ~/Qt/6.7.0/macos/lib/QtCore.framework/QtCore /Users/henry/Qt/6.7.0/macos/lib/QtCore.framework/QtCore: Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit dynamically linked shared library x86_64] [arm64] /Users/henry/Qt/6.7.0/macos/lib/QtCore.framework/QtCore (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64 /Users/henry/Qt/6.7.0/macos/lib/QtCore.framework/QtCore (for architecture arm64): Mach-O 64-bit dynamically linked shared library arm64
However homebrew (where you usually get the MySql stuff) only gives you one architecture, so you have to check with file
wrote on 16 Apr 2024, 19:45 last edited by@hskoglund Hi,
I installed mysql from its official site.
I checked the architecture/Users/boyankiovtorov/Qt/6.7.0/macos/lib/QtCore.framework/QtCore: Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit dynamically linked shared library x86_64] [arm64] /Users/boyankiovtorov/Qt/6.7.0/macos/lib/QtCore.framework/QtCore (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64 /Users/boyankiovtorov/Qt/6.7.0/macos/lib/QtCore.framework/QtCore (for architecture arm64): Mach-O 64-bit dynamically linked shared library arm64
Should I install through homebrew?
-
wrote on 16 Apr 2024, 19:47 last edited by
Hi, just try your qt-cmake command again, but this put this at the end:
-DCMAKE_OSX_ARCHITECTURES="arm64"
-
Hi @SGaist don't worry about Qt's architectures, I think at least from 6.2 the online version installs both of them, e.g.
file ~/Qt/6.7.0/macos/lib/QtCore.framework/QtCore /Users/henry/Qt/6.7.0/macos/lib/QtCore.framework/QtCore: Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit dynamically linked shared library x86_64] [arm64] /Users/henry/Qt/6.7.0/macos/lib/QtCore.framework/QtCore (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64 /Users/henry/Qt/6.7.0/macos/lib/QtCore.framework/QtCore (for architecture arm64): Mach-O 64-bit dynamically linked shared library arm64
However homebrew (where you usually get the MySql stuff) only gives you one architecture, so you have to check with file
@hskoglund if it's a custom build, I want to worry about it :-)
@DeadSo0ul the long variant would be to get a multi-arch MySQL or get it for each architecture and use lipo to put them together.
-
Hi, just try your qt-cmake command again, but this put this at the end:
-DCMAKE_OSX_ARCHITECTURES="arm64"
wrote on 16 Apr 2024, 19:52 last edited by@hskoglund
I still get the same resultld: warning: ignoring file '/usr/local/mysql-8.3.0-macos14-arm64/lib/libmysqlclient.23.dylib': found architecture 'arm64', required architecture 'x86_64'
-
wrote on 16 Apr 2024, 19:54 last edited by hskoglund
You need to nuke (delete) the previous build/directory
or do a new download and then try qt-cmake again (with -DCMAKE_OSX_ARCHITECTURES="arm64" added at the end) -
You need to nuke (delete) the previous build/directory
or do a new download and then try qt-cmake again (with -DCMAKE_OSX_ARCHITECTURES="arm64" added at the end)wrote on 16 Apr 2024, 19:59 last edited by DeadSo0ul@hskoglund If I do understand you correctly I had done it before running the command as the files built were easy to track
Ignore the directory where I build as I overkill the whole process for no reason
I did try to build in another directory but without success
-
wrote on 16 Apr 2024, 20:06 last edited by
No I mean delete all of the /Users/boyankiovtorov/Qt/6.7.0/Src/qtbase/src/plugins/sqldrivers directory
If you don't have a copy easiest is just to download the 6.7.0 source again. -
wrote on 16 Apr 2024, 20:11 last edited by
Here's how I built MySQL (some time ago :-) using Homebrew
Download Qt sources in ~/Downloads then do these commands:brew install mysql cd ~/Downloads/qt-everywhere-src-6.7.0/qtbase/src/plugins/sqldrivers ~/Qt/6.7.0/macos/bin/qt-cmake -DMySQL_LIBRARY=/usr/local/opt/mysql/lib/libmysqlclient.dylib -DMySQL_INCLUDE_DIR=/usr/local/opt/mysql/include/mysql -DCMAKE_OSX_ARCHITECTURES="arm64" . make
-
Here's how I built MySQL (some time ago :-) using Homebrew
Download Qt sources in ~/Downloads then do these commands:brew install mysql cd ~/Downloads/qt-everywhere-src-6.7.0/qtbase/src/plugins/sqldrivers ~/Qt/6.7.0/macos/bin/qt-cmake -DMySQL_LIBRARY=/usr/local/opt/mysql/lib/libmysqlclient.dylib -DMySQL_INCLUDE_DIR=/usr/local/opt/mysql/include/mysql -DCMAKE_OSX_ARCHITECTURES="arm64" . make
wrote on 16 Apr 2024, 20:33 last edited by@hskoglund
It was the same way I built the driver for 6.2 but still not workingcd ~/Downloads/qt-everywhere-src-6.7.0/qtbase/src/plugins/sqldrivers boyankiovtorov@Boyans-MacBook-Air sqldrivers % ~/Qt/6.7.0/macos/bin/qt-cmake -DMySQL_LIBRARY=/opt/homebrew/opt/mysql/lib/libmysqlclient.dylib -DMySQL_INCLUDE_DIR=/opt/homebrew/opt/mysql/include/mysql -DCMAKE_OSX_ARCHITECTURES="arm64" .
it gives a warning that ninja is recommended
CMake Warning at /Users/boyankiovtorov/Qt/6.7.0/macos/lib/cmake/Qt6/QtBuildHelpers.cmake:12 (message): The officially supported CMake generator for building Qt is Ninja / Ninja Multi-Config. You are using: 'Unix Makefiles' instead. Thus, you might encounter issues. Use at your own risk. Call Stack (most recent call first): /Users/boyankiovtorov/Qt/6.7.0/macos/lib/cmake/Qt6/QtBuildHelpers.cmake:381 (qt_internal_validate_cmake_generator) /Users/boyankiovtorov/Qt/6.7.0/macos/lib/cmake/Qt6/QtBuild.cmake:4 (qt_internal_setup_build_and_global_variables) /Users/boyankiovtorov/Qt/6.7.0/macos/lib/cmake/Qt6/QtSetup.cmake:6 (include) /Users/boyankiovtorov/Qt/6.7.0/macos/lib/cmake/Qt6/QtBuildRepoHelpers.cmake:21 (include) /Users/boyankiovtorov/Qt/6.7.0/macos/lib/cmake/Qt6/QtBuildRepoHelpers.cmake:112 (qt_build_internals_set_up_private_api) CMakeLists.txt:26 (qt_prepare_standalone_project)
but the error is still the same
[ 41%] Linking CXX shared module ../plugins/sqldrivers/libqsqlmysql.dylib ld: warning: ignoring file '/opt/homebrew/Cellar/mysql/8.3.0_1/lib/libmysqlclient.23.dylib': found architecture 'arm64', required architecture 'x86_64'
-
wrote on 16 Apr 2024, 20:47 last edited by
If you check the MySql dll with file, e.g.:
file /opt/homebrew/opt/mysql/lib/libmysqlclient.dylib
If it says "x86_64" then you need to download/install a dylib/dll with the same name but has the architecture "arm64"
-
If you check the MySql dll with file, e.g.:
file /opt/homebrew/opt/mysql/lib/libmysqlclient.dylib
If it says "x86_64" then you need to download/install a dylib/dll with the same name but has the architecture "arm64"
wrote on 16 Apr 2024, 20:54 last edited by@hskoglund It is arm64
/opt/homebrew/opt/mysql/lib/libmysqlclient.dylib: Mach-O 64-bit dynamically linked shared library arm64
-
wrote on 16 Apr 2024, 21:19 last edited by
Hi, indeed I just tried it myself and something's changed with 6.7.0, that switch -DCMAKE_OSX_ARCHITECTURES="arm64" does not seem to work anymore :-(
I remember that was a bug before and that you had to edit some cmake text file, i'll check...
1/22