... QSqlDatabase db = QSqlDatabase::addDatabase("QSQLITE"); db.setDatabaseName(":memory:"); if (!db.open()) { ...
C++ (Qt)cd C:\MySQL\include
C++ (Qt)dlltool –input-def libmysql.def –dllname libmysql.dll –output-lib libmysql.a -k
C++ (Qt)cd C:\Qt\2009.04\qt\src\plugins\sqldrivers\mysql
C++ (Qt)qmake -o Makefile «INCLUDEPATH+=C:\MySQL\include» «LIBS+=C:\MySQL\lib\opt\libmysql.lib» mysql.pro
C++ (Qt)mingw32-make
C:\Qt\Desktop\Qt\4.7.3\mingw\plugins\sqldrivers\mysql>mingw32-makemingw32-make -f Makefile.Debugmingw32-make[1]: Entering directory `C:/Qt/Desktop/Qt/4.7.3/mingw/plugins/sqldrivers/mysql'g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc -mthreads -Wl -Wl,-subsystem,windows -o debug\mysql.exe -L"c:\Qt\Desktop\Qt\4.7.3\mingw\lib" -lmingw32 -lqtmaind C:\MySQL\lib\opt\libmysql.lib -lQtGuid4 -lQtCored4 -LC:\OpenSSL-Win32_full\libc:\Qt\Desktop\Qt\4.7.3\mingw\lib/libqtmaind.a(qtmain_win.o): In function `WinMain@16':c:/ndk_buildrepos/qt-desktop/src/winmain/qtmain_win.cpp:131: undefined reference to `qMain(int, char**)'collect2: ld returned 1 exit statusmingw32-make[1]: *** [debug\mysql.exe] Error 1mingw32-make[1]: Leaving directory `C:/Qt/Desktop/Qt/4.7.3/mingw/plugins/sqldrivers/mysql'mingw32-make: *** [debug] Error 2C:\Qt\Desktop\Qt\4.7.3\mingw\plugins\sqldrivers\mysql>