How use MYSQL on QT
-
Hello,
For my project, i would like use MySQL on QT but, The plugins don't work. I try to yuse the plugions sqlLite, the application can be connect on the database but don't find the differents table. I try to use the plugins MySQL but it's doesn't exist.I saesh on th web an i find this tuto : https://doc.qt.io/qt-5/sql-driver.html
The differents step is difficulte. One the first, when i install the QT, i don't find the files recommended (i find the plugins directory but not the files)
I try to execute this commande :
qmake MYSQL_INCDIR="C:\Program Files\MySQL\Connector C++ 8.0\include" MYSQL_LIBDIR="C:\Program Files\MySQL\Connector C++ 8.0\lib64"
i have this output :
Running configuration tests... 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 'nmake'. Once everything is built, you must run 'nmake install'. Qt will be installed into 'C:\Qt\5.15.2\msvc2019_64'. Prior to reconfiguration, make sure you remove any leftovers from the previous build.
I continue, i try this commande :
nmake
but i have this error :
rc /NOLOGO -DUNICODE -D_UNICODE -DWIN32 -D_ENABLE_EXTENDED_ALIGNED_STORAGE -DWIN64 -DQT_NO_LINKED_LIST -DQT_NO_JAVA_STYLE_ITERATORS -DNDEBUG -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_OMIT_COMPLETE -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_JSON1 -DSQLITE_OMIT_LOAD_EXTENSION -DQT_DEPRECATED_WARNINGS -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DNDEBUG -DQT_NO_EXCEPTIONS -DQT_NO_DEBUG -DQT_PLUGIN -DQT_SQL_LIB -DQT_CORE_LIB -D_WINDLL -fo .obj\release\qsqlite_resource.res qsqlite_resource.rc qsqlite_resource.rc(1) : fatal error RC1015: cannot open include file 'windows.h'. NMAKE : fatal error U1077: '"C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64\rc.EXE"' : code retour '0x1' Stop. NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.30.30705\bin\Hostx64\x64\nmake.exe"' : code retour '0x2' Stop. NMAKE : fatal error U1077: 'cd' : code retour '0x2' Stop.
Can you help me please, i don't find solution and it's verry important
-
@vin212 said in How use MYSQL on QT:
MySql .................................. no
...
I continue, i try this commande : nmake
Why? As you can see qmake did not find your libs, so why do you think 'nmake' will do anything for mysql? As written in the documentation look into the logs and see why the libs were not found or usable.