PDA

View Full Version : (Another) Can't build MySql driver on Mac OSX



Gretsch
29th January 2015, 11:16
Seems to be a popular question but I can't find a suitable answer from those past questions....
Am following instructions at http://doc-snapshot.qt-project.org/qt5-5.4/sql-driver.html

I run qmake like so:


~/Qt/5.4/clang_64/bin/qmake "INCLUDEPATH+=/usr/local/mysql-5.6.22-osx10.8-x86_64/include" "LIBS+=-L/usr/local/lib -lmysqlclient_r" mysql.pro

So far, so good.


make

Chugs along, and then:


/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -headerpad_max_install_names -Wl,-syslibroot,/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk -stdlib=libc++ -mmacosx-version-min=10.7 -single_module -dynamiclib -o libqsqlmysql.dylib .obj/release/main.o .obj/release/qsql_mysql.o .obj/release/moc_qsql_mysql_p.o -F/Users/vi/Qt/5.4/clang_64/lib -L/usr/local/lib -L/opt/local/lib/mysql55/mysql -lmysqlclient_r -lz -framework QtSql -framework QtCore -framework DiskArbitration -framework IOKit
ld: warning: directory not found for option '-L/opt/local/lib/mysql55/mysql'
ld: library not found for -lmysqlclient_r
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [../../../../plugins/sqldrivers/libqsqlmysql.dylib] Error 1
make: *** [release-all] Error 2

I don't seem to have the file mysqlclient_r OR mysql55 folder on my system... Is Xcode looking for them ?

Gretsch
2nd February 2015, 21:44
OK, I'm now following the docs that came with Qt Creator (Building the Drivers Using Configure)
I run configure -help and it appears the client libraries are detected.
I run configure -plugin-sql-mysql
I run make.


/Users/vi/Qt/5.4/Src/qtbase/src/plugins/sqldrivers/mysql/main.cpp:67:10: fatal error: 'main.moc' file not found
#include "main.moc"
^
1 error generated.
make[6]: *** [.obj/release/main.o] Error 1
make[5]: *** [release-all] Error 2
make[4]: *** [sub-mysql-make_first] Error 2
make[3]: *** [sub-sqldrivers-make_first] Error 2
make[2]: *** [sub-plugins-make_first] Error 2
make[1]: *** [sub-src-make_first] Error 2
make: *** [module-qtbase-make_first] Error 2

Dunno what to make (excuse the pun) of this, why isn't main.mc generated ?