MySQL driver problem [Solved]
Page |
1 |
Hello i’m try to install the MySQL driver.
According to the following instructions: sql-driver [doc.qt.nokia.com]
Now I have everything downloaded, and then I need to run the following commands.
reimp -d libmysql.lib
But then I get the following error: reimp is not recognized internal or external command.
Does anyone know what I might be doing wrong?
Thanks,
Wim
I use:
Windows 7 ×64.
Qt Creator 2.4.1 (Based on Qt 4.7.4 (32 bit)).
20 replies
Hi, try this
1. Install MySql server with libs (for exam C:\MySQL)
2. Install QtSDK with source (for exam C:\QtSDK)
3. Run Qt 4.7.3 for Desktop (mingw)
- set QTDIR=C:\QtSDK\QtSource\
- set mySQLDIR=C:\MySQL
- cd %QTDIR%\src\plugins\sqldrivers\mysql
- qmake "INCLUDEPATH+=%mySQLDIR%\include" "LIBS+=%mySQLDIR%\lib\opt\libmysql.lib"-o Makefile mysql.pro
- mingw32-make
4. Go to QTDIR\src\plugins\sqldrivers\mysql and copy in
C:\QtSQK\Desktop\Qt\4.7.3\mingw\plugins\sqldrivers 2 files – libqsqlmysqld4.a and qsqlmysqld4.dll.
5. And from C:\MySQL\bin file libmysql.dll in dir C:\WINDOWS
Test:
qDebug() << QSqlDatabase::drivers();
must be (“QSQLITE”, “QMYSQL3”, “QMYSQL”)
Is your QtSDK installed in C:\QtSDK, or E:\QtSDK? Your first “set” command is using E: not C:
And it’s supposed to be “set QTDIR= “ not “set QTDIR- “
Also, it should be “set mySQLDIR= “ not “set mSQLDIR- “
And when you do the “cd”, it should take you to whatever directory has the “mysql.pro”, not remain in system32.
I think I’m one step further.
but I get 2 errors.
- Setting up environment for Qt usage...
- C:\Windows\system32>set QTDIR = C:\QtSDK\QtSource\4.7.4
- C:\Windows\system32>set mySQLDIR=C:\MySQL
- C:\Windows\system32>cd %QTDIR%\src\plugins\sqldrivers\mysql
- Het systeem kan het opgegeven pad niet vinden.
- C:\Windows\system32>cd C:\QtSDK\QtSource\4.7.4\src\plugins\sqldrivers\mysql
- Het systeem kan het opgegeven pad niet vinden.
- C:\Windows\system32>QTDIR=C:\QtSDK\QtSources\
- QTDIR wordt niet herkend als een interne
- of externe opdracht, programma of batchbestand.
- C:\Windows\system32>set QTDIR=C:\QtSDK\QtSources\4.7.4
- C:\Windows\system32>set mySQLDIR=C:\MySQL
- C:\Windows\system32>cd %QTDIR%\src\plugins\sqldrivers\mysql
- C:\QtSDK\QtSources\4.7.4\src\plugins\sqldrivers\mysql>qmake "INCLUDEPATH+=%mySQL
- DIR%\include" "LIBS+=%mySQLDIR%\lib\opt\libmysql.lib"-o Makefile mysql.pro
- WARNING: (internal):1: Unescaped backslashes are deprecated.
- c:\QtSDK\QtSources\4.7.4\src\plugins\sqldrivers\mysql\Makefile:9: Parse Error ('
- first: debug')
- Error processing project file: Makefile
- WARNING: (internal):1: Unescaped backslashes are deprecated.
- WARNING: (internal):1: Unescaped backslashes are deprecated.
- WARNING: (internal):1: Unescaped backslashes are deprecated.
- C:\QtSDK\QtSources\4.7.4\src\plugins\sqldrivers\mysql>mingw32-make
- mingw32-make -f Makefile.Debug
- mingw32-make[1]: Entering directory `C:/QtSDK/QtSources/4.7.4/src/plugins/sqldri
- vers/mysql'
- g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -
- DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_DLL -DQT_PLUGIN -DQT_SQL_LIB -
- DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_H
- AVE_SSE2 -DQT_THREAD_SUPPORT -I"c:\QtSDK\Desktop\Qt\4.7.4\mingw\include\QtCore"
- -I"c:\QtSDK\Desktop\Qt\4.7.4\mingw\include\QtSql" -I"c:\QtSDK\Desktop\Qt\4.7.4\m
- ingw\include" -I"c:\MySQL\include" -I"c:\QtSDK\Desktop\Qt\4.7.4\mingw\include\Ac
- tiveQt" -I"debug" -I"c:\QtSDK\Desktop\Qt\4.7.4\mingw\mkspecs\default" -o debug\m
- ain.o main.cpp
- C:\QtSDK\Desktop\Qt\4.7.4\mingw\bin\moc.exe -DUNICODE -DQT_LARGEFILE_SUPPORT -DQ
- T_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_DLL -DQT_PLUGIN -DQT_SQL_LIB -DQ
- T_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAV
- E_SSE2 -DQT_THREAD_SUPPORT -I"c:\QtSDK\Desktop\Qt\4.7.4\mingw\include\QtCore" -I
- "c:\QtSDK\Desktop\Qt\4.7.4\mingw\include\QtSql" -I"c:\QtSDK\Desktop\Qt\4.7.4\min
- gw\include" -I"c:\MySQL\include" -I"c:\QtSDK\Desktop\Qt\4.7.4\mingw\include\Acti
- veQt" -I"debug" -I"c:\QtSDK\Desktop\Qt\4.7.4\mingw\mkspecs\default" -D__GNUC__ -
- DWIN32 ..\..\..\sql\drivers\mysql\qsql_mysql.cpp -o debug\qsql_mysql.moc
- g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -
- DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_DLL -DQT_PLUGIN -DQT_SQL_LIB -
- DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_H
- AVE_SSE2 -DQT_THREAD_SUPPORT -I"c:\QtSDK\Desktop\Qt\4.7.4\mingw\include\QtCore"
- -I"c:\QtSDK\Desktop\Qt\4.7.4\mingw\include\QtSql" -I"c:\QtSDK\Desktop\Qt\4.7.4\m
- ingw\include" -I"c:\MySQL\include" -I"c:\QtSDK\Desktop\Qt\4.7.4\mingw\include\Ac
- tiveQt" -I"debug" -I"c:\QtSDK\Desktop\Qt\4.7.4\mingw\mkspecs\default" -o debug\q
- sql_mysql.o ..\..\..\sql\drivers\mysql\qsql_mysql.cpp
- C:\QtSDK\Desktop\Qt\4.7.4\mingw\bin\moc.exe -DUNICODE -DQT_LARGEFILE_SUPPORT -DQ
- T_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_DLL -DQT_PLUGIN -DQT_SQL_LIB -DQ
- T_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAV
- E_SSE2 -DQT_THREAD_SUPPORT -I"c:\QtSDK\Desktop\Qt\4.7.4\mingw\include\QtCore" -I
- "c:\QtSDK\Desktop\Qt\4.7.4\mingw\include\QtSql" -I"c:\QtSDK\Desktop\Qt\4.7.4\min
- gw\include" -I"c:\MySQL\include" -I"c:\QtSDK\Desktop\Qt\4.7.4\mingw\include\Acti
- veQt" -I"debug" -I"c:\QtSDK\Desktop\Qt\4.7.4\mingw\mkspecs\default" -D__GNUC__ -
- DWIN32 ..\..\..\sql\drivers\mysql\qsql_mysql.h -o debug\moc_qsql_mysql.cpp
- g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -
- DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_DLL -DQT_PLUGIN -DQT_SQL_LIB -
- DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_H
- AVE_SSE2 -DQT_THREAD_SUPPORT -I"c:\QtSDK\Desktop\Qt\4.7.4\mingw\include\QtCore"
- -I"c:\QtSDK\Desktop\Qt\4.7.4\mingw\include\QtSql" -I"c:\QtSDK\Desktop\Qt\4.7.4\m
- ingw\include" -I"c:\MySQL\include" -I"c:\QtSDK\Desktop\Qt\4.7.4\mingw\include\Ac
- tiveQt" -I"debug" -I"c:\QtSDK\Desktop\Qt\4.7.4\mingw\mkspecs\default" -o debug\m
- oc_qsql_mysql.o debug\moc_qsql_mysql.cpp
- windres -i qsqlmysqld_resource.rc -o debug\qsqlmysqld_resource_res.o --include-d
- ir=. -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_AS
- CII -DQT_DLL -DQT_PLUGIN -DQT_SQL_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNO
- W -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT
- g++ -mthreads -shared -Wl,--out-implib,debug\libqsqlmysqld4.a -o debug\qsqlmysql
- d4.dll debug/main.o debug/qsql_mysql.o debug/moc_qsql_mysql.o -L"c:\QtSDK\Deskt
- op\Qt\4.7.4\mingw\lib" debug\qsqlmysqld_resource_res.o C:\MySQL\lib\opt\libmysql
- .lib-o -lQtSqld4 -lQtCored4
- g++: C:\MySQL\lib\opt\libmysql.lib-o: No such file or directory
- mingw32-make[1]: *** [debug\qsqlmysqld4.dll] Error 1
- mingw32-make[1]: Leaving directory `C:/QtSDK/QtSources/4.7.4/src/plugins/sqldriv
- ers/mysql'
- mingw32-make: *** [debug] Error 2
- C:\QtSDK\QtSources\4.7.4\src\plugins\sqldrivers\mysql>
You must log in to post a reply. Not a member yet? Register here!






