Set-up MariaDB library file location programmatically?
-
And after all that still the same:
simonplatten@Simons-iMac sqldrivers % cat config.log Command line: MYSQL_INCDIR=/usr/local/Cellar/mariadb/10.4.13/include/mysql MYSQL_LIBDIR=/usr/local/Cellar/mariadb/10.4.13/lib MYSQL_LIBS=-lmariadb Global lib dirs: [] [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib] Global inc dirs: [/usr/local/opt/openssl/include] [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/11.0.3/include /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include] loaded result for library config.sqldrivers.libraries.db2 Trying source 0 (type inline) of library db2 ... => source failed condition 'config.win32'. Trying source 1 (type inline) of library db2 ... sqlcli.h not found in [] and global paths. sqlcli1.h not found in [] and global paths. => source produced no result. test config.sqldrivers.libraries.db2 FAILED loaded result for library config.sqldrivers.libraries.ibase Trying source 0 (type inline) of library ibase ... => source failed condition 'config.win32'. Trying source 1 (type inline) of library ibase ... ibase.h not found in [] and global paths. => source produced no result. test config.sqldrivers.libraries.ibase FAILED loaded result for library config.sqldrivers.libraries.mysql Trying source 0 (type mysqlConfig) of library mysql ... + /usr/local/bin/mysql_config --version > 10.4.6 + /usr/local/bin/mysql_config --libs_r > -L/usr/local/Cellar/mariadb/10.4.6_1/lib -lmariadb -lz -liconv -lssl -lcrypto + /usr/local/bin/mysql_config --include > -I/usr/local/Cellar/mariadb/10.4.6_1/include/mysql -I/usr/local/Cellar/mariadb/10.4.6_1/include/mysql/.. + cd /Users/simonplatten/Qt/5.14.2/Src/qtbase/src/plugins/sqldrivers/config.tests/mysql && /Users/simonplatten/Qt/5.14.2/clang_64/bin/qmake "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += shared warn_off console single_arch" 'INCLUDEPATH += /usr/local/opt/openssl/include' 'QMAKE_USE += mysql' 'QMAKE_LIBS_MYSQL = -L/usr/local/Cellar/mariadb/10.4.6_1/lib' 'QMAKE_INCDIR_MYSQL = /usr/local/Cellar/mariadb/10.4.6_1/include/mysql /usr/local/Cellar/mariadb/10.4.6_1/include' /Users/simonplatten/Qt/5.14.2/Src/qtbase/src/plugins/sqldrivers/config.tests/mysql > Info: creating stash file /Users/simonplatten/Qt/5.14.2/Src/qtbase/src/plugins/sqldrivers/config.tests/.qmake.stash + cd /Users/simonplatten/Qt/5.14.2/Src/qtbase/src/plugins/sqldrivers/config.tests/mysql && MAKEFLAGS= make > /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -c -pipe -stdlib=libc++ -O2 -std=gnu++11 -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -mmacosx-version-min=10.13 -w -fPIC -I. -I/usr/local/opt/openssl/include -I/usr/local/Cellar/mariadb/10.4.6_1/include/mysql -I/usr/local/Cellar/mariadb/10.4.6_1/include -I/Users/simonplatten/Qt/5.14.2/clang_64/mkspecs/macx-clang -o main.o main.cpp > /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -stdlib=libc++ -headerpad_max_install_names -arch x86_64 -Wl,-syslibroot,/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -mmacosx-version-min=10.13 -Wl,-rpath,@executable_path/../Frameworks -o mysql main.o -L/usr/local/Cellar/mariadb/10.4.6_1/lib > Undefined symbols for architecture x86_64: > "_mysql_get_client_version", referenced from: > _main in main.o > ld: symbol(s) not found for architecture x86_64 > clang: error: linker command failed with exit code 1 (use -v to see invocation) > make: *** [mysql] Error 1 => source failed verification. Trying source 1 (type mysqlConfig) of library mysql ... + /usr/local/bin/mysql_config --version > 10.4.6 + /usr/local/bin/mysql_config --libs > -L/usr/local/Cellar/mariadb/10.4.6_1/lib -lmariadb -lz -liconv -lssl -lcrypto + /usr/local/bin/mysql_config --include > -I/usr/local/Cellar/mariadb/10.4.6_1/include/mysql -I/usr/local/Cellar/mariadb/10.4.6_1/include/mysql/.. + cd /Users/simonplatten/Qt/5.14.2/Src/qtbase/src/plugins/sqldrivers/config.tests/mysql && /Users/simonplatten/Qt/5.14.2/clang_64/bin/qmake "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += shared warn_off console single_arch" 'INCLUDEPATH += /usr/local/opt/openssl/include' 'QMAKE_USE += mysql' 'QMAKE_LIBS_MYSQL = -L/usr/local/Cellar/mariadb/10.4.6_1/lib' 'QMAKE_INCDIR_MYSQL = /usr/local/Cellar/mariadb/10.4.6_1/include/mysql /usr/local/Cellar/mariadb/10.4.6_1/include' /Users/simonplatten/Qt/5.14.2/Src/qtbase/src/plugins/sqldrivers/config.tests/mysql + cd /Users/simonplatten/Qt/5.14.2/Src/qtbase/src/plugins/sqldrivers/config.tests/mysql && MAKEFLAGS= make clean && MAKEFLAGS= make > rm -f main.o > rm -f *~ core *.core > /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -c -pipe -stdlib=libc++ -O2 -std=gnu++11 -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -mmacosx-version-min=10.13 -w -fPIC -I. -I/usr/local/opt/openssl/include -I/usr/local/Cellar/mariadb/10.4.6_1/include/mysql -I/usr/local/Cellar/mariadb/10.4.6_1/include -I/Users/simonplatten/Qt/5.14.2/clang_64/mkspecs/macx-clang -o main.o main.cpp > /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -stdlib=libc++ -headerpad_max_install_names -arch x86_64 -Wl,-syslibroot,/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -mmacosx-version-min=10.13 -Wl,-rpath,@executable_path/../Frameworks -o mysql main.o -L/usr/local/Cellar/mariadb/10.4.6_1/lib > Undefined symbols for architecture x86_64: > "_mysql_get_client_version", referenced from: > _main in main.o > ld: symbol(s) not found for architecture x86_64 > clang: error: linker command failed with exit code 1 (use -v to see invocation) > make: *** [mysql] Error 1 => source failed verification. Trying source 2 (type mysqlConfig) of library mysql ... + /usr/local/bin/mysql_config --version > 10.4.6 + /usr/local/bin/mysql_config --libs_r > -L/usr/local/Cellar/mariadb/10.4.6_1/lib -lmariadb -lz -liconv -lssl -lcrypto + /usr/local/bin/mysql_config --include > -I/usr/local/Cellar/mariadb/10.4.6_1/include/mysql -I/usr/local/Cellar/mariadb/10.4.6_1/include/mysql/.. + cd /Users/simonplatten/Qt/5.14.2/Src/qtbase/src/plugins/sqldrivers/config.tests/mysql && /Users/simonplatten/Qt/5.14.2/clang_64/bin/qmake "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += shared warn_off console single_arch" 'INCLUDEPATH += /usr/local/opt/openssl/include' 'QMAKE_USE += mysql' 'QMAKE_LIBS_MYSQL = -L/usr/local/Cellar/mariadb/10.4.6_1/lib -lmariadb -lz -liconv -lssl -lcrypto' 'QMAKE_INCDIR_MYSQL = /usr/local/Cellar/mariadb/10.4.6_1/include/mysql /usr/local/Cellar/mariadb/10.4.6_1/include' /Users/simonplatten/Qt/5.14.2/Src/qtbase/src/plugins/sqldrivers/config.tests/mysql + cd /Users/simonplatten/Qt/5.14.2/Src/qtbase/src/plugins/sqldrivers/config.tests/mysql && MAKEFLAGS= make clean && MAKEFLAGS= make > rm -f main.o > rm -f *~ core *.core > /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -c -pipe -stdlib=libc++ -O2 -std=gnu++11 -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -mmacosx-version-min=10.13 -w -fPIC -I. -I/usr/local/opt/openssl/include -I/usr/local/Cellar/mariadb/10.4.6_1/include/mysql -I/usr/local/Cellar/mariadb/10.4.6_1/include -I/Users/simonplatten/Qt/5.14.2/clang_64/mkspecs/macx-clang -o main.o main.cpp > /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -stdlib=libc++ -headerpad_max_install_names -arch x86_64 -Wl,-syslibroot,/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -mmacosx-version-min=10.13 -Wl,-rpath,@executable_path/../Frameworks -o mysql main.o -L/usr/local/Cellar/mariadb/10.4.6_1/lib -lmariadb -lz -liconv -lssl -lcrypto > ld: library not found for -lssl > clang: error: linker command failed with exit code 1 (use -v to see invocation) > make: *** [mysql] Error 1 => source failed verification. Trying source 3 (type mysqlConfig) of library mysql ... + /usr/local/bin/mysql_config --version > 10.4.6 + /usr/local/bin/mysql_config --libs > -L/usr/local/Cellar/mariadb/10.4.6_1/lib -lmariadb -lz -liconv -lssl -lcrypto + /usr/local/bin/mysql_config --include > -I/usr/local/Cellar/mariadb/10.4.6_1/include/mysql -I/usr/local/Cellar/mariadb/10.4.6_1/include/mysql/.. + cd /Users/simonplatten/Qt/5.14.2/Src/qtbase/src/plugins/sqldrivers/config.tests/mysql && /Users/simonplatten/Qt/5.14.2/clang_64/bin/qmake "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += shared warn_off console single_arch" 'INCLUDEPATH += /usr/local/opt/openssl/include' 'QMAKE_USE += mysql' 'QMAKE_LIBS_MYSQL = -L/usr/local/Cellar/mariadb/10.4.6_1/lib -lmariadb -lz -liconv -lssl -lcrypto' 'QMAKE_INCDIR_MYSQL = /usr/local/Cellar/mariadb/10.4.6_1/include/mysql /usr/local/Cellar/mariadb/10.4.6_1/include' /Users/simonplatten/Qt/5.14.2/Src/qtbase/src/plugins/sqldrivers/config.tests/mysql + cd /Users/simonplatten/Qt/5.14.2/Src/qtbase/src/plugins/sqldrivers/config.tests/mysql && MAKEFLAGS= make clean && MAKEFLAGS= make > rm -f main.o > rm -f *~ core *.core > /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -c -pipe -stdlib=libc++ -O2 -std=gnu++11 -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -mmacosx-version-min=10.13 -w -fPIC -I. -I/usr/local/opt/openssl/include -I/usr/local/Cellar/mariadb/10.4.6_1/include/mysql -I/usr/local/Cellar/mariadb/10.4.6_1/include -I/Users/simonplatten/Qt/5.14.2/clang_64/mkspecs/macx-clang -o main.o main.cpp > /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -stdlib=libc++ -headerpad_max_install_names -arch x86_64 -Wl,-syslibroot,/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -mmacosx-version-min=10.13 -Wl,-rpath,@executable_path/../Frameworks -o mysql main.o -L/usr/local/Cellar/mariadb/10.4.6_1/lib -lmariadb -lz -liconv -lssl -lcrypto > ld: library not found for -lssl > clang: error: linker command failed with exit code 1 (use -v to see invocation) > make: *** [mysql] Error 1 => source failed verification. Trying source 4 (type inline) of library mysql ... mysql.h not found in [/usr/local/include] and global paths. => source produced no result. Trying source 5 (type inline) of library mysql ... => source failed condition 'config.win32'. Trying source 6 (type inline) of library mysql ... mysql.h not found in [/usr/local/include] and global paths. => source produced no result. test config.sqldrivers.libraries.mysql FAILED loaded result for library config.sqldrivers.libraries.oci Trying source 0 (type inline) of library oci ... => source failed condition 'config.win32'. Trying source 1 (type inline) of library oci ... oci.h not found in [] and global paths. => source produced no result. test config.sqldrivers.libraries.oci FAILED loaded result for library config.sqldrivers.libraries.odbc Trying source 0 (type inline) of library odbc ... => source failed condition 'config.win32'. Trying source 1 (type inline) of library odbc ... sql.h not found in [] and global paths. sqlext.h not found in [] and global paths. => source produced no result. Trying source 2 (type inline) of library odbc ... => source failed condition '!config.win32 && !config.darwin'. test config.sqldrivers.libraries.odbc FAILED loaded result for library config.sqldrivers.libraries.psql Trying source 0 (type pkgConfig) of library psql ... pkg-config use disabled globally. => source produced no result. Trying source 1 (type psqlConfig) of library psql ... pg_config not found. => source produced no result. Trying source 2 (type psqlEnv) of library psql ... => source failed condition 'config.win32'. Trying source 3 (type psqlEnv) of library psql ... libpq-fe.h not found in [] and global paths. => source produced no result. test config.sqldrivers.libraries.psql FAILED loaded result for library config.sqldrivers.libraries.sqlite2 Trying source 0 (type inline) of library sqlite2 ... sqlite.h not found in [] and global paths. => source produced no result. test config.sqldrivers.libraries.sqlite2 FAILED loaded result for library config.sqldrivers.libraries.tds Trying source 0 (type sybaseEnv) of library tds ... => source failed condition 'config.win32'. Trying source 1 (type sybaseEnv) of library tds ... + cd /Users/simonplatten/Qt/5.14.2/Src/qtbase/src/plugins/sqldrivers/config.tests/tds && /Users/simonplatten/Qt/5.14.2/clang_64/bin/qmake "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += shared warn_off console single_arch" 'INCLUDEPATH += /usr/local/opt/openssl/include' 'QMAKE_USE += tds' 'QMAKE_LIBS_TDS = -lsybdb' /Users/simonplatten/Qt/5.14.2/Src/qtbase/src/plugins/sqldrivers/config.tests/tds + cd /Users/simonplatten/Qt/5.14.2/Src/qtbase/src/plugins/sqldrivers/config.tests/tds && MAKEFLAGS= make > /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -c -pipe -stdlib=libc++ -O2 -std=gnu++11 -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -mmacosx-version-min=10.13 -w -fPIC -I. -I/usr/local/opt/openssl/include -I/Users/simonplatten/Qt/5.14.2/clang_64/mkspecs/macx-clang -o main.o main.cpp > main.cpp:2:10: fatal error: 'sybfront.h' file not found > #include <sybfront.h> > ^~~~~~~~~~~~ > 1 error generated. > make: *** [main.o] Error 1 => source failed verification. test config.sqldrivers.libraries.tds FAILED
-
-
@Bonnie , that looks like its done the trick.
simonplatten@Simons-iMac sqldrivers % $QTDIRBIN/qmake -- MYSQL_INCDIR="/usr/local/Cellar/mariadb/10.4.13/include/mysql" "MYSQL_LIBDIR=/usr/local/Cellar/mariadb/10.4.13/lib" MYSQL_LIBS="-lmariadb" Running configuration tests... Checking for DB2 (IBM)... no Checking for InterBase... no Checking for MySQL... yes Checking for OCI (Oracle)... no Checking for ODBC... no Checking for PostgreSQL... no Checking for SQLite (version 2)... no Checking for TDS (Sybase)... no Done running configuration tests. Configure summary: Qt Sql Drivers: DB2 (IBM) .............................. no InterBase .............................. no MySql .................................. yes OCI (Oracle) ........................... no ODBC ................................... no PostgreSQL ............................. no SQLite2 ................................ no SQLite ................................. yes Using system provided SQLite ......... no TDS (Sybase) ........................... no Qt is now configured for building. Just run 'make'. Once everything is built, you must run 'make install'. Qt will be installed into '/Users/simonplatten/Qt/5.14.2/clang_64'. Prior to reconfiguration, make sure you remove any leftovers from the previous build.
-
@SPlatten
It is actually in the doc:If something goes wrong and you want qmake to recheck your available drivers, you must remove config.cache in <QTDIR>/qtbase/src/plugins/sqldrivers - otherwise qmake will not search for the available drivers again.
I think the doc should make that sentence more sight-catching.
Many people who had their first qmake command unsuccessful would be stucked there, with a never-changing config.log. -
@Bonnie , Hello, I'm trying to rebuild the library again and from my notes:
$QTDIRBIN/qmake -- MYSQL_INCDIR="/usr/local/Cellar/mariadb/10.4.13/include/mysql" "MYSQL_LIBDIR=/usr/local/Cellar/mariadb/10.4.13/lib" MYSQL_LIBS="-lmariadb"
This results in:
Usage: /Users/sy/Qt/5.15.1/clang_64/bin/qmake [mode] [options] [files] QMake has two modes, one mode for generating project files based on some heuristics, and the other for generating makefiles. Normally you shouldn't need to specify a mode, as makefile generation is the default mode for qmake, but you may use this to test qmake on an existing project Mode: -project Put qmake into project file generation mode In this mode qmake interprets [files] as files to be added to the .pro file. By default, all files with known source extensions are added. Note: The created .pro file probably will need to be edited. For example add the QT variable to specify what modules are required. -makefile Put qmake into makefile generation mode (default) In this mode qmake interprets files as project files to be processed, if skipped qmake will try to find a project file in your current working directory Warnings Options: -Wnone Turn off all warnings; specific ones may be re-enabled by later -W options -Wall Turn on all warnings -Wparser Turn on parser warnings -Wlogic Turn on logic warnings (on by default) -Wdeprecated Turn on deprecation warnings (on by default) Options: * You can place any variable assignment in options and it will be * * processed as if it was in [files]. These assignments will be * * processed before [files] by default. * -o file Write output to file -d Increase debug level -t templ Overrides TEMPLATE as templ -tp prefix Overrides TEMPLATE so that prefix is prefixed into the value -help This help -v Version information -early All subsequent variable assignments will be parsed right before default_pre.prf -before All subsequent variable assignments will be parsed right before [files] (the default) -after All subsequent variable assignments will be parsed after [files] -late All subsequent variable assignments will be parsed right after default_post.prf -norecursive Don't do a recursive search -recursive Do a recursive search -set <prop> <value> Set persistent property -unset <prop> Unset persistent property -query <prop> Query persistent property. Show all if <prop> is empty. -qtconf file Use file instead of looking for qt.conf -cache file Use file as cache [makefile mode only] -spec spec Use spec as QMAKESPEC [makefile mode only] -nocache Don't use a cache file [makefile mode only] -nodepend Don't generate dependencies [makefile mode only] -nomoc Don't generate moc targets [makefile mode only] -nopwd Don't look for files in pwd [project mode only]
I've checked $QTDIRBIN, which contains:
QTDIRBIN=/Users/sy/Qt/5.15.1/clang_64/bin
MariaDB is installed in:
/usr/local/Cellar/mariadb/10.5.7
Can you help?
-
@SPlatten said in Set-up MariaDB library file location programmatically?:
the path of make is specified by the QTDIRBIN environment variable and I've checked the qmake application is in that location
That is not what I asked.
In which directory are you when you call qmake? -
@jsulm , Ok, thank you, that was part of the problem. I am in:
/Users/sy/Qt/5.15.1/Src/qtbase/src/plugins/sqldrivers
The output now is:
Running configuration tests... Checking for DB2 (IBM)... no Checking for InterBase... no Checking for MySQL... no Checking for OCI (Oracle)... no Checking for ODBC... no Checking for PostgreSQL... no Checking for SQLite (version 2)... no Checking for TDS (Sybase)... no Done running configuration tests. Configure summary: Qt Sql Drivers: DB2 (IBM) .............................. no InterBase .............................. no MySql .................................. no OCI (Oracle) ........................... no ODBC ................................... no PostgreSQL ............................. no SQLite2 ................................ no SQLite ................................. yes Using system provided SQLite ......... no TDS (Sybase) ........................... no Qt is now configured for building. Just run 'make'. Once everything is built, you must run 'make install'. Qt will be installed into '/Users/sy/Qt/5.15.1/clang_64'. Prior to reconfiguration, make sure you remove any leftovers from the previous build.
How do I get MySql set to yes ?
I've removed config.cache and re-run qmake, still the same results.
-
@SPlatten said in Set-up MariaDB library file location programmatically?:
How do I get MySql set to yes ?
As always in such a situation: check config.log for failed MySQL test and see what exactly the problem was...
-
-
@SPlatten said in Set-up MariaDB library file location programmatically?:
sybfront.h
Google says that header file is part of freetds-dev package (on Ubuntu).