QTDriver not Load
-
Hi guys.
I'm in trouble to load MySQL drivers on QT.
I need to add MySQL in my project to make Server/Client connection with MySQL.
I have the same problem this guy :https://forum.qt.io/topic/92626/cant-connect-to-mysql-database-qmysql-driver-not-loaded
I'm trying to replicate steps, But i'm stuck on qmakefile step.I'm having trouble to execute these code lines
This code is on .bat file.
My cmd input{
D:\Qt\5.11.2\Src\qtbase\src\plugins
qmake -- MYSQL_INCDIR="C:\Program Files\MySQL\MySQL Server 8.0\include" MYSQL_LIBDIR="C:\Program
MySQL\MySQL Server 8.0\lib"mingw32-make sub-mysql
}
My cmd output{C:\Users\lucya\Desktop>D:\Qt\5.11.2\Src\qtbase\src\plugins\sqldrivers
'D:\Qt\5.11.2\Src\qtbase\src\plugins\sqldrivers' is not recognized as an internal or external command,
operable program or batch file.C:\Users\lucya\Desktop>qmake -- MYSQL_INCDIR="C:\Program Files\MySQL\MySQL Server 8.0\include" MYSQL_LIBDIR="C:\Program Files\MySQL\MySQL Server 8.0\lib"
Usage: 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 projectMode:
-project Put qmake into project file generation mode
In this mode qmake interprets files as files to
be built,
defaults to *; *; *; *.ts; *.xlf; *.qrc
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 directoryWarnings 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]
C:\Users\lucya\Desktop>mingw32-make sub-mysql
mingw32-make: *** No rule to make target 'sub-mysql'. Stop.
}What i'm doing wrong?
I'm using qt 5.11.2 MingW 32Bit. MySQL 8.0
Thanks for attention.
-
Hi,
Didn't you forget the
cd
command to move to the right folder before callingqmake
? -
I didn't forget it. I have removed in the edition
My cmd input{
cd D:\Qt\5.11.2\Src\qtbase\src\plugins
qmake -- MYSQL_INCDIR="C:\Program Files\MySQL\MySQL Server 8.0\include" MYSQL_LIBDIR="C:\Program
MySQL\MySQL Server 8.0\lib"mingw32-make sub-mysql
} -
@lucaynnofrota This error means you DID forget cd:
"'D:\Qt\5.11.2\Src\qtbase\src\plugins\sqldrivers' is not recognized as an internal or external command,
operable program or batch file."You already asked same question here: https://forum.qt.io/topic/92626/cant-connect-to-mysql-database-qmysql-driver-not-loaded
-
Now i'm stuck with this error:
Input:
cd %QTDIR%\qtbase\src\plugins\sqldrivers
set mysql=C:\Program Files\MySQL\MySQL Server 8.0
qmake -- MYSQL_INCDIR=%mysql%\include "MYSQL_LIBDIR=%mysql%\lib\opt"
Output:
Cannot read D:/Qt/5.11.2/Src/qtbase/src/plugins/sqldrivers/qtsqldrivers-config.pri: No such file or directory
Project ERROR: Library 'mysql' is not defined.Someone knows what am i suppose to do?
-
@lucaynnofrota said in QTDriver not Load:
D:/Qt/5.11.2/Src/qtbase/src/plugins/sqldrivers/qtsqldrivers-config.pri
Does this file exist?
-
@jsulm
Thanks for replay. I've already solved this problem. But i'm haven't solved mysql problem.cmd:
input:
C:\Users\lucya\Desktop\Qt Driver>set mysql=C:\Program Files\MySQL\MySQL Server 8.0 C:\Users\lucya\Desktop\Qt Driver>cd D:\Qt\5.11.2\Src\qtbase\src\plugins\sqldrivers\ C:\Users\lucya\Desktop\Qt Driver>qmake "INCLUDEPATH+=C:\Program Files\MySQL\MySQL Server 8.0\\include" "LIBS+=C:\Program Files\MySQL\MySQL Server 8.0\\lib\\libmysql.lib" -o Makefile D:\Qt\5.11.2\Src\qtbase\src\plugins\sqldrivers\
output:
Info: creating stash file C:\Users\lucya\Desktop\Qt Driver\.qmake.stash Running configuration tests... Checking for DB2 (IBM)... no Checking for InterBase... no Checking for MySQL... no Checking for OCI (Oracle)... no Checking for ODBC... yes Checking for PostgreSQL... no Checking for SQLite (version 2)... no Checking for TDS (Sybase)... no Done running configuration tests.
Configure summary:
Qt Sql: DB2 (IBM) .............................. no InterBase .............................. no MySql .................................. no OCI (Oracle) ........................... no ODBC ................................... yes PostgreSQL ............................. no SQLite2 ................................ no SQLite ................................. yes Using system provided SQLite ......... no TDS (Sybase) ........................... no Qt is now configured for building. Just run 'mingw32-make'. Once everything is built, Qt is installed. You should NOT run 'mingw32-make install'. Note that this build cannot be deployed to other machines or devices. Prior to reconfiguration, make sure you remove any leftovers from the previous build.
####################################### config.log ###########################
Command line: looking for library db2 Trying source 0 (type inline) of library db2 ... + cd /d "C:\Users\lucya\Desktop\Qt Driver\config.tests\db2" && D:\Qt\5.11.2\mingw53_32\bin\qmake.exe "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += shared warn_off console single_arch" "QMAKE_LIBDIR += C:\\openssl\\lib C:\\Utils\\my_sql\\mysql-5.6.11-win32\\lib C:\\Utils\\postgresql\\pgsql\\lib" "INCLUDEPATH += C:\\openssl\\include C:\\Utils\\my_sql\\mysql-5.6.11-win32\\include C:\\Utils\\postgresql\\pgsql\\include" "LIBS += -ldb2cli" "C:/Users/lucya/Desktop/Qt Driver/config.tests/db2" > Info: creating stash file C:\Users\lucya\Desktop\Qt Driver\config.tests\.qmake.stash + cd /d "C:\Users\lucya\Desktop\Qt Driver\config.tests\db2" && set MAKEFLAGS=& mingw32-make > g++ -c -fno-keep-inline-dllexport -O2 -std=gnu++11 -w -fexceptions -mthreads -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -I. -IC:\openssl\include -IC:\Utils\my_sql\mysql-5.6.11-win32\include -IC:\Utils\postgresql\pgsql\include -ID:\Qt\5.11.2\mingw53_32\mkspecs\win32-g++ -o main.o main.cpp > main.cpp:2:20: fatal error: sqlcli.h: No such file or directory > compilation terminated. > Makefile:413: recipe for target 'main.o' failed > mingw32-make: *** [main.o] Error 1 => source failed verification. Trying source 1 (type inline) of library db2 ... => source failed condition '!config.win32'. test config.sqldrivers.libraries.db2 FAILED looking for library ibase Trying source 0 (type inline) of library ibase ... + cd /d "C:\Users\lucya\Desktop\Qt Driver\config.tests\ibase" && D:\Qt\5.11.2\mingw53_32\bin\qmake.exe "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += shared warn_off console single_arch" "QMAKE_LIBDIR += C:\\openssl\\lib C:\\Utils\\my_sql\\mysql-5.6.11-win32\\lib C:\\Utils\\postgresql\\pgsql\\lib" "INCLUDEPATH += C:\\openssl\\include C:\\Utils\\my_sql\\mysql-5.6.11-win32\\include C:\\Utils\\postgresql\\pgsql\\include" "LIBS += -lgds32_ms" "C:/Users/lucya/Desktop/Qt Driver/config.tests/ibase" + cd /d "C:\Users\lucya\Desktop\Qt Driver\config.tests\ibase" && set MAKEFLAGS=& mingw32-make > g++ -c -fno-keep-inline-dllexport -O2 -std=gnu++11 -w -fexceptions -mthreads -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -I. -IC:\openssl\include -IC:\Utils\my_sql\mysql-5.6.11-win32\include -IC:\Utils\postgresql\pgsql\include -ID:\Qt\5.11.2\mingw53_32\mkspecs\win32-g++ -o main.o main.cpp > main.cpp:2:19: fatal error: ibase.h: No such file or directory > compilation terminated. > Makefile:415: recipe for target 'main.o' failed > mingw32-make: *** [main.o] Error 1 => source failed verification. Trying source 1 (type inline) of library ibase ... => source failed condition '!config.win32'. test config.sqldrivers.libraries.ibase FAILED looking for library mysql Trying source 0 (type mysqlConfig) of library mysql ... mysql_config not found. => source produced no result. Trying source 1 (type mysqlConfig) of library mysql ... mysql_config not found. => source produced no result. Trying source 2 (type mysqlConfig) of library mysql ... mysql_config not found. => source produced no result. Trying source 3 (type mysqlConfig) of library mysql ... mysql_config not found. => source produced no result. Trying source 4 (type inline) of library mysql ... => source failed condition '!config.win32'. Trying source 5 (type inline) of library mysql ... + cd /d "C:\Users\lucya\Desktop\Qt Driver\config.tests\mysql" && D:\Qt\5.11.2\mingw53_32\bin\qmake.exe "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += shared warn_off console single_arch" "QMAKE_LIBDIR += C:\\openssl\\lib C:\\Utils\\my_sql\\mysql-5.6.11-win32\\lib C:\\Utils\\postgresql\\pgsql\\lib" "INCLUDEPATH += C:\\openssl\\include C:\\Utils\\my_sql\\mysql-5.6.11-win32\\include C:\\Utils\\postgresql\\pgsql\\include" "LIBS += -llibmysql" "C:/Users/lucya/Desktop/Qt Driver/config.tests/mysql" + cd /d "C:\Users\lucya\Desktop\Qt Driver\config.tests\mysql" && set MAKEFLAGS=& mingw32-make > g++ -c -fno-keep-inline-dllexport -O2 -std=gnu++11 -w -fexceptions -mthreads -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -I. -IC:\openssl\include -IC:\Utils\my_sql\mysql-5.6.11-win32\include -IC:\Utils\postgresql\pgsql\include -ID:\Qt\5.11.2\mingw53_32\mkspecs\win32-g++ -o main.o main.cpp > main.cpp:5:19: fatal error: mysql.h: No such file or directory > compilation terminated. > Makefile:415: recipe for target 'main.o' failed > mingw32-make: *** [main.o] Error 1 => source failed verification. Trying source 6 (type inline) of library mysql ... => source failed condition '!config.win32'. test config.sqldrivers.libraries.mysql FAILED looking for library oci Trying source 0 (type inline) of library oci ... + cd /d "C:\Users\lucya\Desktop\Qt Driver\config.tests\oci" && D:\Qt\5.11.2\mingw53_32\bin\qmake.exe "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += shared warn_off console single_arch" "QMAKE_LIBDIR += C:\\openssl\\lib C:\\Utils\\my_sql\\mysql-5.6.11-win32\\lib C:\\Utils\\postgresql\\pgsql\\lib" "INCLUDEPATH += C:\\openssl\\include C:\\Utils\\my_sql\\mysql-5.6.11-win32\\include C:\\Utils\\postgresql\\pgsql\\include" "LIBS += -loci" "C:/Users/lucya/Desktop/Qt Driver/config.tests/oci" + cd /d "C:\Users\lucya\Desktop\Qt Driver\config.tests\oci" && set MAKEFLAGS=& mingw32-make > g++ -c -fno-keep-inline-dllexport -O2 -std=gnu++11 -w -fexceptions -mthreads -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -I. -IC:\openssl\include -IC:\Utils\my_sql\mysql-5.6.11-win32\include -IC:\Utils\postgresql\pgsql\include -ID:\Qt\5.11.2\mingw53_32\mkspecs\win32-g++ -o main.o main.cpp > main.cpp:2:17: fatal error: oci.h: No such file or directory > compilation terminated. > Makefile:415: recipe for target 'main.o' failed > mingw32-make: *** [main.o] Error 1 => source failed verification. Trying source 1 (type inline) of library oci ... => source failed condition '!config.win32'. test config.sqldrivers.libraries.oci FAILED looking for library odbc Trying source 0 (type inline) of library odbc ... + cd /d "C:\Users\lucya\Desktop\Qt Driver\config.tests\odbc" && D:\Qt\5.11.2\mingw53_32\bin\qmake.exe "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += shared warn_off console single_arch" "QMAKE_LIBDIR += C:\\openssl\\lib C:\\Utils\\my_sql\\mysql-5.6.11-win32\\lib C:\\Utils\\postgresql\\pgsql\\lib" "INCLUDEPATH += C:\\openssl\\include C:\\Utils\\my_sql\\mysql-5.6.11-win32\\include C:\\Utils\\postgresql\\pgsql\\include" "LIBS += -lodbc32" "C:/Users/lucya/Desktop/Qt Driver/config.tests/odbc" + cd /d "C:\Users\lucya\Desktop\Qt Driver\config.tests\odbc" && set MAKEFLAGS=& mingw32-make > g++ -c -fno-keep-inline-dllexport -O2 -std=gnu++11 -w -fexceptions -mthreads -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -I. -IC:\openssl\include -IC:\Utils\my_sql\mysql-5.6.11-win32\include -IC:\Utils\postgresql\pgsql\include -ID:\Qt\5.11.2\mingw53_32\mkspecs\win32-g++ -o main.o main.cpp > g++ -Wl,-s -Wl,-subsystem,console -mthreads -o odbc.exe main.o -LC:\openssl\lib -LC:\Utils\my_sql\mysql-5.6.11-win32\lib -LC:\Utils\postgresql\pgsql\lib -lodbc32 => source accepted. test config.sqldrivers.libraries.odbc succeeded looking for library 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 ... + cd /d "C:\Users\lucya\Desktop\Qt Driver\config.tests\psql" && D:\Qt\5.11.2\mingw53_32\bin\qmake.exe "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += shared warn_off console single_arch" "QMAKE_LIBDIR += C:\\openssl\\lib C:\\Utils\\my_sql\\mysql-5.6.11-win32\\lib C:\\Utils\\postgresql\\pgsql\\lib" "INCLUDEPATH += C:\\openssl\\include C:\\Utils\\my_sql\\mysql-5.6.11-win32\\include C:\\Utils\\postgresql\\pgsql\\include" "LIBS += -llibpq -lws2_32 -ladvapi32" "C:/Users/lucya/Desktop/Qt Driver/config.tests/psql" + cd /d "C:\Users\lucya\Desktop\Qt Driver\config.tests\psql" && set MAKEFLAGS=& mingw32-make > g++ -c -fno-keep-inline-dllexport -O2 -std=gnu++11 -w -fexceptions -mthreads -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -I. -IC:\openssl\include -IC:\Utils\my_sql\mysql-5.6.11-win32\include -IC:\Utils\postgresql\pgsql\include -ID:\Qt\5.11.2\mingw53_32\mkspecs\win32-g++ -o main.o main.cpp > main.cpp:2:22: fatal error: libpq-fe.h: No such file or directory > compilation terminated. > Makefile:415: recipe for target 'main.o' failed > mingw32-make: *** [main.o] Error 1 => source failed verification. Trying source 3 (type psqlEnv) of library psql ... => source failed condition '!config.win32'. test config.sqldrivers.libraries.psql FAILED looking for library sqlite2 Trying source 0 (type inline) of library sqlite2 ... + cd /d "C:\Users\lucya\Desktop\Qt Driver\config.tests\sqlite2" && D:\Qt\5.11.2\mingw53_32\bin\qmake.exe "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += shared warn_off console single_arch" "QMAKE_LIBDIR += C:\\openssl\\lib C:\\Utils\\my_sql\\mysql-5.6.11-win32\\lib C:\\Utils\\postgresql\\pgsql\\lib" "INCLUDEPATH += C:\\openssl\\include C:\\Utils\\my_sql\\mysql-5.6.11-win32\\include C:\\Utils\\postgresql\\pgsql\\include" "LIBS += -lsqlite" "C:/Users/lucya/Desktop/Qt Driver/config.tests/sqlite2" + cd /d "C:\Users\lucya\Desktop\Qt Driver\config.tests\sqlite2" && set MAKEFLAGS=& mingw32-make > g++ -c -fno-keep-inline-dllexport -O2 -std=gnu++11 -w -fexceptions -mthreads -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -I. -IC:\openssl\include -IC:\Utils\my_sql\mysql-5.6.11-win32\include -IC:\Utils\postgresql\pgsql\include -ID:\Qt\5.11.2\mingw53_32\mkspecs\win32-g++ -o main.o main.cpp > main.cpp:2:20: fatal error: sqlite.h: No such file or directory > compilation terminated. > Makefile:415: recipe for target 'main.o' failed > mingw32-make: *** [main.o] Error 1 => source failed verification. test config.sqldrivers.libraries.sqlite2 FAILED looking for library tds Trying source 0 (type sybaseEnv) of library tds ... + cd /d "C:\Users\lucya\Desktop\Qt Driver\config.tests\tds" && D:\Qt\5.11.2\mingw53_32\bin\qmake.exe "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += shared warn_off console single_arch" "QMAKE_LIBDIR += C:\\openssl\\lib C:\\Utils\\my_sql\\mysql-5.6.11-win32\\lib C:\\Utils\\postgresql\\pgsql\\lib" "INCLUDEPATH += C:\\openssl\\include C:\\Utils\\my_sql\\mysql-5.6.11-win32\\include C:\\Utils\\postgresql\\pgsql\\include" "LIBS += -lNTWDBLIB" "C:/Users/lucya/Desktop/Qt Driver/config.tests/tds" + cd /d "C:\Users\lucya\Desktop\Qt Driver\config.tests\tds" && set MAKEFLAGS=& mingw32-make > g++ -c -fno-keep-inline-dllexport -O2 -std=gnu++11 -w -fexceptions -mthreads -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -I. -IC:\openssl\include -IC:\Utils\my_sql\mysql-5.6.11-win32\include -IC:\Utils\postgresql\pgsql\include -ID:\Qt\5.11.2\mingw53_32\mkspecs\win32-g++ -o main.o main.cpp > main.cpp:2:22: fatal error: sybfront.h: No such file or directory > compilation terminated. > Makefile:415: recipe for target 'main.o' failed > mingw32-make: *** [main.o] Error 1 => source failed verification. Trying source 1 (type sybaseEnv) of library tds ... => source failed condition '!config.win32'. test config.sqldrivers.libraries.tds FAILED ####################################### config.cache ########################### cache.platform = win32-g++ cache.xplatform = win32-g++ cache.db2._KEYS_ = result msgs cache.db2.result = false cache.db2.msgs = "Trying source 0 (type inline) of library db2 ..." "+ cd /d \"C:\\Users\\lucya\\Desktop\\Qt Driver\\config.tests\\db2\" && D:\\Qt\\5.11.2\\mingw53_32\\bin\\qmake.exe \"CONFIG -= qt debug_and_release app_bundle lib_bundle\" \"CONFIG += shared warn_off console single_arch\" \"QMAKE_LIBDIR += C:\\\\openssl\\\\lib C:\\\\Utils\\\\my_sql\\\\mysql-5.6.11-win32\\\\lib C:\\\\Utils\\\\postgresql\\\\pgsql\\\\lib\" \"INCLUDEPATH += C:\\\\openssl\\\\include C:\\\\Utils\\\\my_sql\\\\mysql-5.6.11-win32\\\\include C:\\\\Utils\\\\postgresql\\\\pgsql\\\\include\" \"LIBS += -ldb2cli\" \"C:/Users/lucya/Desktop/Qt Driver/config.tests/db2\"" "> Info: creating stash file C:\\Users\\lucya\\Desktop\\Qt Driver\\config.tests\\.qmake.stash" "+ cd /d \"C:\\Users\\lucya\\Desktop\\Qt Driver\\config.tests\\db2\" && set MAKEFLAGS=& mingw32-make" "> g++ -c -fno-keep-inline-dllexport -O2 -std=gnu++11 -w -fexceptions -mthreads -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -I. -IC:\\openssl\\include -IC:\\Utils\\my_sql\\mysql-5.6.11-win32\\include -IC:\\Utils\\postgresql\\pgsql\\include -ID:\\Qt\\5.11.2\\mingw53_32\\mkspecs\\win32-g++ -o main.o main.cpp" "> main.cpp:2:20: fatal error: sqlcli.h: No such file or directory" "> compilation terminated." "> Makefile:413: recipe for target \'main.o\' failed" "> mingw32-make: *** [main.o] Error 1" " => source failed verification." "Trying source 1 (type inline) of library db2 ..." " => source failed condition \'!config.win32\'." cache.ibase._KEYS_ = result msgs cache.ibase.result = false cache.ibase.msgs = "Trying source 0 (type inline) of library ibase ..." "+ cd /d \"C:\\Users\\lucya\\Desktop\\Qt Driver\\config.tests\\ibase\" && D:\\Qt\\5.11.2\\mingw53_32\\bin\\qmake.exe \"CONFIG -= qt debug_and_release app_bundle lib_bundle\" \"CONFIG += shared warn_off console single_arch\" \"QMAKE_LIBDIR += C:\\\\openssl\\\\lib C:\\\\Utils\\\\my_sql\\\\mysql-5.6.11-win32\\\\lib C:\\\\Utils\\\\postgresql\\\\pgsql\\\\lib\" \"INCLUDEPATH += C:\\\\openssl\\\\include C:\\\\Utils\\\\my_sql\\\\mysql-5.6.11-win32\\\\include C:\\\\Utils\\\\postgresql\\\\pgsql\\\\include\" \"LIBS += -lgds32_ms\" \"C:/Users/lucya/Desktop/Qt Driver/config.tests/ibase\"" "+ cd /d \"C:\\Users\\lucya\\Desktop\\Qt Driver\\config.tests\\ibase\" && set MAKEFLAGS=& mingw32-make" "> g++ -c -fno-keep-inline-dllexport -O2 -std=gnu++11 -w -fexceptions -mthreads -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -I. -IC:\\openssl\\include -IC:\\Utils\\my_sql\\mysql-5.6.11-win32\\include -IC:\\Utils\\postgresql\\pgsql\\include -ID:\\Qt\\5.11.2\\mingw53_32\\mkspecs\\win32-g++ -o main.o main.cpp" "> main.cpp:2:19: fatal error: ibase.h: No such file or directory" "> compilation terminated." "> Makefile:415: recipe for target \'main.o\' failed" "> mingw32-make: *** [main.o] Error 1" " => source failed verification." "Trying source 1 (type inline) of library ibase ..." " => source failed condition \'!config.win32\'." cache.mysql._KEYS_ = result msgs cache.mysql.result = false cache.mysql.msgs = "Trying source 0 (type mysqlConfig) of library mysql ..." "mysql_config not found." " => source produced no result." "Trying source 1 (type mysqlConfig) of library mysql ..." "mysql_config not found." " => source produced no result." "Trying source 2 (type mysqlConfig) of library mysql ..." "mysql_config not found." " => source produced no result." "Trying source 3 (type mysqlConfig) of library mysql ..." "mysql_config not found." " => source produced no result." "Trying source 4 (type inline) of library mysql ..." " => source failed condition \'!config.win32\'." "Trying source 5 (type inline) of library mysql ..." "+ cd /d \"C:\\Users\\lucya\\Desktop\\Qt Driver\\config.tests\\mysql\" && D:\\Qt\\5.11.2\\mingw53_32\\bin\\qmake.exe \"CONFIG -= qt debug_and_release app_bundle lib_bundle\" \"CONFIG += shared warn_off console single_arch\" \"QMAKE_LIBDIR += C:\\\\openssl\\\\lib C:\\\\Utils\\\\my_sql\\\\mysql-5.6.11-win32\\\\lib C:\\\\Utils\\\\postgresql\\\\pgsql\\\\lib\" \"INCLUDEPATH += C:\\\\openssl\\\\include C:\\\\Utils\\\\my_sql\\\\mysql-5.6.11-win32\\\\include C:\\\\Utils\\\\postgresql\\\\pgsql\\\\include\" \"LIBS += -llibmysql\" \"C:/Users/lucya/Desktop/Qt Driver/config.tests/mysql\"" "+ cd /d \"C:\\Users\\lucya\\Desktop\\Qt Driver\\config.tests\\mysql\" && set MAKEFLAGS=& mingw32-make" "> g++ -c -fno-keep-inline-dllexport -O2 -std=gnu++11 -w -fexceptions -mthreads -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -I. -IC:\\openssl\\include -IC:\\Utils\\my_sql\\mysql-5.6.11-win32\\include -IC:\\Utils\\postgresql\\pgsql\\include -ID:\\Qt\\5.11.2\\mingw53_32\\mkspecs\\win32-g++ -o main.o main.cpp" "> main.cpp:5:19: fatal error: mysql.h: No such file or directory" "> compilation terminated." "> Makefile:415: recipe for target \'main.o\' failed" "> mingw32-make: *** [main.o] Error 1" " => source failed verification." "Trying source 6 (type inline) of library mysql ..." " => source failed condition \'!config.win32\'." cache.oci._KEYS_ = result msgs cache.oci.result = false cache.oci.msgs = "Trying source 0 (type inline) of library oci ..." "+ cd /d \"C:\\Users\\lucya\\Desktop\\Qt Driver\\config.tests\\oci\" && D:\\Qt\\5.11.2\\mingw53_32\\bin\\qmake.exe \"CONFIG -= qt debug_and_release app_bundle lib_bundle\" \"CONFIG += shared warn_off console single_arch\" \"QMAKE_LIBDIR += C:\\\\openssl\\\\lib C:\\\\Utils\\\\my_sql\\\\mysql-5.6.11-win32\\\\lib C:\\\\Utils\\\\postgresql\\\\pgsql\\\\lib\" \"INCLUDEPATH += C:\\\\openssl\\\\include C:\\\\Utils\\\\my_sql\\\\mysql-5.6.11-win32\\\\include C:\\\\Utils\\\\postgresql\\\\pgsql\\\\include\" \"LIBS += -loci\" \"C:/Users/lucya/Desktop/Qt Driver/config.tests/oci\"" "+ cd /d \"C:\\Users\\lucya\\Desktop\\Qt Driver\\config.tests\\oci\" && set MAKEFLAGS=& mingw32-make" "> g++ -c -fno-keep-inline-dllexport -O2 -std=gnu++11 -w -fexceptions -mthreads -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -I. -IC:\\openssl\\include -IC:\\Utils\\my_sql\\mysql-5.6.11-win32\\include -IC:\\Utils\\postgresql\\pgsql\\include -ID:\\Qt\\5.11.2\\mingw53_32\\mkspecs\\win32-g++ -o main.o main.cpp" "> main.cpp:2:17: fatal error: oci.h: No such file or directory" "> compilation terminated." "> Makefile:415: recipe for target \'main.o\' failed" "> mingw32-make: *** [main.o] Error 1" " => source failed verification." "Trying source 1 (type inline) of library oci ..." " => source failed condition \'!config.win32\'." cache.odbc._KEYS_ = result msgs source sources.0.libs sources.0.includedir sources.0.cflags sources.0.version sources.0.export cache.odbc.result = true cache.odbc.msgs = "Trying source 0 (type inline) of library odbc ..." "+ cd /d \"C:\\Users\\lucya\\Desktop\\Qt Driver\\config.tests\\odbc\" && D:\\Qt\\5.11.2\\mingw53_32\\bin\\qmake.exe \"CONFIG -= qt debug_and_release app_bundle lib_bundle\" \"CONFIG += shared warn_off console single_arch\" \"QMAKE_LIBDIR += C:\\\\openssl\\\\lib C:\\\\Utils\\\\my_sql\\\\mysql-5.6.11-win32\\\\lib C:\\\\Utils\\\\postgresql\\\\pgsql\\\\lib\" \"INCLUDEPATH += C:\\\\openssl\\\\include C:\\\\Utils\\\\my_sql\\\\mysql-5.6.11-win32\\\\include C:\\\\Utils\\\\postgresql\\\\pgsql\\\\include\" \"LIBS += -lodbc32\" \"C:/Users/lucya/Desktop/Qt Driver/config.tests/odbc\"" "+ cd /d \"C:\\Users\\lucya\\Desktop\\Qt Driver\\config.tests\\odbc\" && set MAKEFLAGS=& mingw32-make" "> g++ -c -fno-keep-inline-dllexport -O2 -std=gnu++11 -w -fexceptions -mthreads -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -I. -IC:\\openssl\\include -IC:\\Utils\\my_sql\\mysql-5.6.11-win32\\include -IC:\\Utils\\postgresql\\pgsql\\include -ID:\\Qt\\5.11.2\\mingw53_32\\mkspecs\\win32-g++ -o main.o main.cpp" "> g++ -Wl,-s -Wl,-subsystem,console -mthreads -o odbc.exe main.o -LC:\\openssl\\lib -LC:\\Utils\\my_sql\\mysql-5.6.11-win32\\lib -LC:\\Utils\\postgresql\\pgsql\\lib -lodbc32 " " => source accepted." cache.odbc.source = 0 cache.odbc.sources.0.libs = -lodbc32 cache.odbc.sources.0.includedir = cache.odbc.sources.0.cflags = cache.odbc.sources.0.version = cache.odbc.sources.0.export = cache.psql._KEYS_ = result msgs cache.psql.result = false cache.psql.msgs = "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 ..." "+ cd /d \"C:\\Users\\lucya\\Desktop\\Qt Driver\\config.tests\\psql\" && D:\\Qt\\5.11.2\\mingw53_32\\bin\\qmake.exe \"CONFIG -= qt debug_and_release app_bundle lib_bundle\" \"CONFIG += shared warn_off console single_arch\" \"QMAKE_LIBDIR += C:\\\\openssl\\\\lib C:\\\\Utils\\\\my_sql\\\\mysql-5.6.11-win32\\\\lib C:\\\\Utils\\\\postgresql\\\\pgsql\\\\lib\" \"INCLUDEPATH += C:\\\\openssl\\\\include C:\\\\Utils\\\\my_sql\\\\mysql-5.6.11-win32\\\\include C:\\\\Utils\\\\postgresql\\\\pgsql\\\\include\" \"LIBS += -llibpq -lws2_32 -ladvapi32\" \"C:/Users/lucya/Desktop/Qt Driver/config.tests/psql\"" "+ cd /d \"C:\\Users\\lucya\\Desktop\\Qt Driver\\config.tests\\psql\" && set MAKEFLAGS=& mingw32-make" "> g++ -c -fno-keep-inline-dllexport -O2 -std=gnu++11 -w -fexceptions -mthreads -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -I. -IC:\\openssl\\include -IC:\\Utils\\my_sql\\mysql-5.6.11-win32\\include -IC:\\Utils\\postgresql\\pgsql\\include -ID:\\Qt\\5.11.2\\mingw53_32\\mkspecs\\win32-g++ -o main.o main.cpp" "> main.cpp:2:22: fatal error: libpq-fe.h: No such file or directory" "> compilation terminated." "> Makefile:415: recipe for target \'main.o\' failed" "> mingw32-make: *** [main.o] Error 1" " => source failed verification." "Trying source 3 (type psqlEnv) of library psql ..." " => source failed condition \'!config.win32\'." cache.sqlite2._KEYS_ = result msgs cache.sqlite2.result = false cache.sqlite2.msgs = "Trying source 0 (type inline) of library sqlite2 ..." "+ cd /d \"C:\\Users\\lucya\\Desktop\\Qt Driver\\config.tests\\sqlite2\" && D:\\Qt\\5.11.2\\mingw53_32\\bin\\qmake.exe \"CONFIG -= qt debug_and_release app_bundle lib_bundle\" \"CONFIG += shared warn_off console single_arch\" \"QMAKE_LIBDIR += C:\\\\openssl\\\\lib C:\\\\Utils\\\\my_sql\\\\mysql-5.6.11-win32\\\\lib C:\\\\Utils\\\\postgresql\\\\pgsql\\\\lib\" \"INCLUDEPATH += C:\\\\openssl\\\\include C:\\\\Utils\\\\my_sql\\\\mysql-5.6.11-win32\\\\include C:\\\\Utils\\\\postgresql\\\\pgsql\\\\include\" \"LIBS += -lsqlite\" \"C:/Users/lucya/Desktop/Qt Driver/config.tests/sqlite2\"" "+ cd /d \"C:\\Users\\lucya\\Desktop\\Qt Driver\\config.tests\\sqlite2\" && set MAKEFLAGS=& mingw32-make" "> g++ -c -fno-keep-inline-dllexport -O2 -std=gnu++11 -w -fexceptions -mthreads -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -I. -IC:\\openssl\\include -IC:\\Utils\\my_sql\\mysql-5.6.11-win32\\include -IC:\\Utils\\postgresql\\pgsql\\include -ID:\\Qt\\5.11.2\\mingw53_32\\mkspecs\\win32-g++ -o main.o main.cpp" "> main.cpp:2:20: fatal error: sqlite.h: No such file or directory" "> compilation terminated." "> Makefile:415: recipe for target \'main.o\' failed" "> mingw32-make: *** [main.o] Error 1" " => source failed verification." cache.tds._KEYS_ = result msgs cache.tds.result = false cache.tds.msgs = "Trying source 0 (type sybaseEnv) of library tds ..." "+ cd /d \"C:\\Users\\lucya\\Desktop\\Qt Driver\\config.tests\\tds\" && D:\\Qt\\5.11.2\\mingw53_32\\bin\\qmake.exe \"CONFIG -= qt debug_and_release app_bundle lib_bundle\" \"CONFIG += shared warn_off console single_arch\" \"QMAKE_LIBDIR += C:\\\\openssl\\\\lib C:\\\\Utils\\\\my_sql\\\\mysql-5.6.11-win32\\\\lib C:\\\\Utils\\\\postgresql\\\\pgsql\\\\lib\" \"INCLUDEPATH += C:\\\\openssl\\\\include C:\\\\Utils\\\\my_sql\\\\mysql-5.6.11-win32\\\\include C:\\\\Utils\\\\postgresql\\\\pgsql\\\\include\" \"LIBS += -lNTWDBLIB\" \"C:/Users/lucya/Desktop/Qt Driver/config.tests/tds\"" "+ cd /d \"C:\\Users\\lucya\\Desktop\\Qt Driver\\config.tests\\tds\" && set MAKEFLAGS=& mingw32-make" "> g++ -c -fno-keep-inline-dllexport -O2 -std=gnu++11 -w -fexceptions -mthreads -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -I. -IC:\\openssl\\include -IC:\\Utils\\my_sql\\mysql-5.6.11-win32\\include -IC:\\Utils\\postgresql\\pgsql\\include -ID:\\Qt\\5.11.2\\mingw53_32\\mkspecs\\win32-g++ -o main.o main.cpp" "> main.cpp:2:22: fatal error: sybfront.h: No such file or directory" "> compilation terminated." "> Makefile:415: recipe for target \'main.o\' failed" "> mingw32-make: *** [main.o] Error 1" " => source failed verification." "Trying source 1 (type sybaseEnv) of library tds ..." " => source failed condition \'!config.win32\'."
####################################### qtsqldrivers-config.pri ###########################
QT.sqldrivers.enabled_features = QT.sqldrivers.disabled_features = QT.sqldrivers.QT_CONFIG = QT.sqldrivers.exports = QT.sqldrivers_private.enabled_features = sql-odbc sql-sqlite QT.sqldrivers_private.disabled_features = sql-db2 sql-ibase sql-mysql sql-oci sql-psql sql-sqlite2 sql-tds system-sqlite QT.sqldrivers_private.libraries = odbc QMAKE_LIBS_ODBC = -lodbc32
-
@lucaynnofrota said in QTDriver not Load:
C:\Utils\postgresql\pgsql\include
It looks like you're trying to build all SQL drivers. Maybe you can only build MySQL? (never tried that)
-
-
Thanks for replay
I don't have qtbase on %QTDIR% folder.
qtbase is on my version folders %QTDIR%\5.11.2\Src\qtbase or %QTDIR%5.12.0\Src\qtbase
Is to suppose to have qtbase on qt directory?
In relation to what you said it is exactly what i'm doing!
cd D:\Qt\5.11.2\Src\qtbase\src\plugins\sqldrivers\ -
@lucaynnofrota What I mean is: do
cd D:\Qt\5.11.2\Src\qtbase\src\plugins\sqldrivers\mysql
instead of
cd D:\Qt\5.11.2\Src\qtbase\src\plugins\sqldrivers\
-
I have tried this but it doesn't work. It's the same output.
-
@lucaynnofrota Do you follow this: http://doc.qt.io/qt-5/sql-driver.html ?
-
Yeah.
I have added to the PATH C:\Qt\Tools\mingw530_32\bin and C:\Qt\5.10.1\mingw53_32\bin
And then i executed this .bat file:set mysql=C:\Program Files\MySQL cd D:\Qt\5.12.0\Src\qtbase\src\plugins\sqldrivers\mysql qmake "INCLUDEPATH+=%mysql%\\MySQL Server 8.0\\include\\mysql.h" "LIBS+=%mysql%\\MySQL Server 8.0\\lib\\libmysql.dll" -o Makefile D:\Qt\5.11.2\Src\qtbase\src\plugins\sqldrivers\ nmake sub-mysql pause
the output is:
Qt Sql: DB2 (IBM) .............................. no InterBase .............................. no MySql .................................. no OCI (Oracle) ........................... no ODBC ................................... yes PostgreSQL ............................. no SQLite2 ................................ no SQLite ................................. yes Using system provided SQLite ......... no TDS (Sybase) ........................... no
-
@lucaynnofrota said in QTDriver not Load:
set mysql=C:\Program Files\MySQL
You should avoid using paths with spaces.
-
@lucaynnofrota
I'm lost: Is your problem still that you don't start out in the right directory for yourqmake
command?? Because you have been showing lines like:C:\Users\lucya\Desktop\Qt Driver>cd D:\Qt\5.11.2\Src\qtbase\src\plugins\sqldrivers\ C:\Users\lucya\Desktop\Qt Driver>qmake "INCLUDEPATH+=C:\Program Files\MySQL\MySQL Server 8.0\\include" "LIBS+=C:\Program Files\MySQL\MySQL Server 8.0\\lib\\libmysql.lib" -o Makefile D:\Qt\5.11.2\Src\qtbase\src\plugins\sqldrivers\
Given that you seem to want to change the current directory to a path on a different drive from where you are, what do you think your first
cd
is accomplishing? On Windows/DOS it does not change the "current" directory (as you can see from the second line's prompt), it only changes the default directory on the other drive (D:
).You have to use
cd /d ...
orpushd ...
, or goD:
, if drive letter is different from current drive, if you want to change "the current directory" for theqmake
.Is this what this is all about?? Or maybe I'm going mad or don't have a clue what the issue is :)
-
@jsulm
Thanks for reply
I copied the files of interest to another folder to try to build. But it did not work.
Input:d: cd D:\Qt\5.12.0\Src\qtbase\src\plugins\sqldrivers\mysql qmake "INCLUDEPATH+=C:\Users\lucya\Desktop\Qt_Driver\include" "LIBS+=C:\Users\lucya\Desktop\Qt_Driver\libs" -o Makefile D:\Qt\5.11.2\Src\qtbase\src\plugins\sqldrivers\ nmake C:\Program~Files\MySQL\MySQL~Server~8.0\include\mysql pause
Output:
D:\>cd D:\Qt\5.12.0\Src\qtbase\src\plugins\sqldrivers\mysql D:\Qt\5.12.0\Src\qtbase\src\plugins\sqldrivers\mysql>qmake "INCLUDEPATH+=C:\Users\lucya\Desktop\Qt_Driver\include" "LIBS+=C:\Users\lucya\Desktop\Qt_Driver\libs" -o Makefile D:\Qt\5.11.2\Src\qtbase\src\plugins\sqldrivers\ Info: creating stash file D:\Qt\5.12.0\Src\qtbase\src\plugins\sqldrivers\mysql\.qmake.stash Running configuration tests... Checking for DB2 (IBM)... no Checking for InterBase... no Checking for MySQL... no Checking for OCI (Oracle)... no Checking for ODBC... yes Checking for PostgreSQL... no Checking for SQLite (version 2)... no Checking for TDS (Sybase)... no Done running configuration tests. Configure summary: Qt Sql: DB2 (IBM) .............................. no InterBase .............................. no MySql .................................. no OCI (Oracle) ........................... no ODBC ................................... yes PostgreSQL ............................. no SQLite2 ................................ no SQLite ................................. yes Using system provided SQLite ......... no TDS (Sybase) ........................... no Qt is now configured for building. Just run 'mingw32-make'. Once everything is built, Qt is installed. You should NOT run 'mingw32-make install'. Note that this build cannot be deployed to other machines or devices. Prior to reconfiguration, make sure you remove any leftovers from the previous build. D:\Qt\5.12.0\Src\qtbase\src\plugins\sqldrivers\mysql>nmake C:\Program~Files\MySQL\MySQL~Server~8.0\include\mysql Microsoft (R) Program Maintenance Utility Version 14.16.27023.1 Copyright (C) Microsoft Corporation. All rights reserved. NMAKE : fatal error U1073: don't know how to make 'C:\Program~Files\MySQL\MySQL~Server~8.0\include\mysql' Stop. D:\Qt\5.12.0\Src\qtbase\src\plugins\sqldrivers\mysql>pause
What is "sub" in documentation?