Qt 5.15.2 MySQL plugin for M1 architecture
-
Hello!
For a few days now, I have been attempting to create a MySQL plugin for my M1 Mac. However, even after finding several guides on the forum, I was not successful, as I have either found guides for Qt 6 or guides for Intel based MacBooks.
I have followed the steps as described on the Qt 5 wiki and I have most probably identified the problem:
> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -stdlib=libc++ -headerpad_max_install_names -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk -mmacosx-version-min=10.13 -Wl,-rpath,@executable_path/../Frameworks -o mysql main.o -L/opt/homebrew/Cellar/mysql/8.0.32/lib -lmysqlclient -L/opt/homebrew/lib -L/opt/homebrew/opt/openssl@1.1/lib > > ld: warning: ignoring file /opt/homebrew/Cellar/mysql/8.0.32/lib/libmysqlclient.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
Is there any way I can make qmake build for arm64 architecture, or is it that I cannot build a MySQL plugin for arm64 architecture whatsoever?
Thank you very much for your time and effort.
-
Hi and welcome to devnet,
You have to build the plugin for x86_64. Qt 5.15.2 was released before the M1 was generally available.
-
The PostgreSQL plugin is already available. The only thing that you may have to do is to update the search path for the library in the plugin based on how you installed PostgreSQL. Way simpler in contrast to building the MySQL plugin.