March 14, 2012

wimschuiteman wimschuiteman
Lab Rat
23 posts

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)).

 Signature 

Regards,
Wim

20 replies

March 14, 2012

Skyrim Skyrim
Lab Rat
44 posts

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)

  1. set QTDIR=C:\QtSDK\QtSource\
  2.  
  3. set mySQLDIR=C:\MySQL
  4.  
  5. cd %QTDIR%\src\plugins\sqldrivers\mysql
  6.  
  7. qmake "INCLUDEPATH+=%mySQLDIR%\include" "LIBS+=%mySQLDIR%\lib\opt\libmysql.lib"-o Makefile mysql.pro
  8.  
  9. 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”)

March 14, 2012

wimschuiteman wimschuiteman
Lab Rat
23 posts

hello
This I also found on the Internet.
But I do not know how to do Step 3.
Should I make a new project with Qt Creator. Or something else?

 Signature 

Regards,
Wim

March 14, 2012

mlong mlong
Mad Scientist
1517 posts

I edited step 3 above for formatting. The individual steps had run together.

 Signature 

Senior Software Engineer
AccuWeather Enterprise Solutions
/* My views and opinions do not necessarily reflect those of my employer.  Void where prohibited. */

March 15, 2012

Skyrim Skyrim
Lab Rat
44 posts

something else )

Run (round button) – All programms – Qt SDK – Desktop – run Qt 4.7.4 for Desktop (mingw) – step 3

March 15, 2012

wimschuiteman wimschuiteman
Lab Rat
23 posts

Thanks for the responses.

I see now that I have Qt 4.8.0.
If I try this code “QTDIR = C: \ QtSDK \ QtSource \ 4.8.0”.
I get the following error: “QTDIR is not recognized internal or external command,”

 Signature 

Regards,
Wim

March 15, 2012

mlong mlong
Mad Scientist
1517 posts

No, the command is:

  1. set QTDIR=C:\QtSDK\QtSource\4.8.0

(mind the spaces)

You’re assigning “C:\QtSDK\QtSource\4.8.0” to a variable called “QTDIR

 Signature 

Senior Software Engineer
AccuWeather Enterprise Solutions
/* My views and opinions do not necessarily reflect those of my employer.  Void where prohibited. */

March 15, 2012

Skyrim Skyrim
Lab Rat
44 posts

be carefully not “QTDIR = C: \ QtSDK \ QtSource \ 4.8.0”

must be “set QTDIR = C:\QtSDK\QtSource\4.8.0”

March 15, 2012

wimschuiteman wimschuiteman
Lab Rat
23 posts

It doesn’t work.
Windows

 Signature 

Regards,
Wim

March 15, 2012

wimschuiteman wimschuiteman
Lab Rat
23 posts

Skyrim wrote:
be carefully not “QTDIR = C: \ QtSDK \ QtSource \ 4.8.0”

must be “set QTDIR = C:\QtSDK\QtSource\4.8.0”

Yes that works.

 Signature 

Regards,
Wim

March 15, 2012

Skyrim Skyrim
Lab Rat
44 posts

Oh yes, its doesn’t work.
please write to

“set QTDIR = C:\QtSDK\QtSource\4.8.0”

March 15, 2012

wimschuiteman wimschuiteman
Lab Rat
23 posts

But now i have another error.Dos window

 Signature 

Regards,
Wim

March 15, 2012

mlong mlong
Mad Scientist
1517 posts

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.

 Signature 

Senior Software Engineer
AccuWeather Enterprise Solutions
/* My views and opinions do not necessarily reflect those of my employer.  Void where prohibited. */

March 15, 2012

wimschuiteman wimschuiteman
Lab Rat
23 posts

My QtSDK is installed in E:\QtSDK.
I have found mysql.pro in the map “E:\QtSDK\QtSources\4.8.0\src\plugins\sqldrivers\mysql”.
libmysql.lib in the map C:\MySQL\MySQL51\lib\opt.
Window

 Signature 

Regards,
Wim

March 15, 2012

wimschuiteman wimschuiteman
Lab Rat
23 posts

I saw that I had forgotten something.
window

 Signature 

Regards,
Wim

March 15, 2012

wimschuiteman wimschuiteman
Lab Rat
23 posts

I think I’m one step further.

but I get 2 errors.

  1. Setting up environment for Qt usage...
  2.  
  3. C:\Windows\system32>set QTDIR = C:\QtSDK\QtSource\4.7.4
  4.  
  5. C:\Windows\system32>set mySQLDIR=C:\MySQL
  6.  
  7. C:\Windows\system32>cd %QTDIR%\src\plugins\sqldrivers\mysql
  8. Het systeem kan het opgegeven pad niet vinden.
  9.  
  10. C:\Windows\system32>cd C:\QtSDK\QtSource\4.7.4\src\plugins\sqldrivers\mysql
  11. Het systeem kan het opgegeven pad niet vinden.
  12.  
  13. C:\Windows\system32>QTDIR=C:\QtSDK\QtSources\
  14. QTDIR wordt niet herkend als een interne
  15. of externe opdracht, programma of batchbestand.
  16.  
  17. C:\Windows\system32>set QTDIR=C:\QtSDK\QtSources\4.7.4
  18.  
  19. C:\Windows\system32>set mySQLDIR=C:\MySQL
  20.  
  21. C:\Windows\system32>cd %QTDIR%\src\plugins\sqldrivers\mysql
  22.  
  23. C:\QtSDK\QtSources\4.7.4\src\plugins\sqldrivers\mysql>qmake "INCLUDEPATH+=%mySQL
  24. DIR%\include" "LIBS+=%mySQLDIR%\lib\opt\libmysql.lib"-o Makefile mysql.pro
  25. WARNING: (internal):1: Unescaped backslashes are deprecated.
  26. c:\QtSDK\QtSources\4.7.4\src\plugins\sqldrivers\mysql\Makefile:9: Parse Error ('
  27. first: debug')
  28. Error processing project file: Makefile
  29. WARNING: (internal):1: Unescaped backslashes are deprecated.
  30. WARNING: (internal):1: Unescaped backslashes are deprecated.
  31. WARNING: (internal):1: Unescaped backslashes are deprecated.
  32.  
  33. C:\QtSDK\QtSources\4.7.4\src\plugins\sqldrivers\mysql>mingw32-make
  34. mingw32-make -f Makefile.Debug
  35. mingw32-make[1]: Entering directory `C:/QtSDK/QtSources/4.7.4/src/plugins/sqldri
  36. vers/mysql'
  37. g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -
  38. DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_DLL -DQT_PLUGIN -DQT_SQL_LIB -
  39. DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_H
  40. AVE_SSE2 -DQT_THREAD_SUPPORT -I"c:\QtSDK\Desktop\Qt\4.7.4\mingw\include\QtCore"
  41. -I"c:\QtSDK\Desktop\Qt\4.7.4\mingw\include\QtSql" -I"c:\QtSDK\Desktop\Qt\4.7.4\m
  42. ingw\include" -I"c:\MySQL\include" -I"c:\QtSDK\Desktop\Qt\4.7.4\mingw\include\Ac
  43. tiveQt" -I"debug" -I"c:\QtSDK\Desktop\Qt\4.7.4\mingw\mkspecs\default" -o debug\m
  44. ain.o main.cpp
  45. C:\QtSDK\Desktop\Qt\4.7.4\mingw\bin\moc.exe -DUNICODE -DQT_LARGEFILE_SUPPORT -DQ
  46. T_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_DLL -DQT_PLUGIN -DQT_SQL_LIB -DQ
  47. T_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAV
  48. E_SSE2 -DQT_THREAD_SUPPORT -I"c:\QtSDK\Desktop\Qt\4.7.4\mingw\include\QtCore" -I
  49. "c:\QtSDK\Desktop\Qt\4.7.4\mingw\include\QtSql" -I"c:\QtSDK\Desktop\Qt\4.7.4\min
  50. gw\include" -I"c:\MySQL\include" -I"c:\QtSDK\Desktop\Qt\4.7.4\mingw\include\Acti
  51. veQt" -I"debug" -I"c:\QtSDK\Desktop\Qt\4.7.4\mingw\mkspecs\default" -D__GNUC__ -
  52. DWIN32 ..\..\..\sql\drivers\mysql\qsql_mysql.cpp -o debug\qsql_mysql.moc
  53. g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -
  54. DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_DLL -DQT_PLUGIN -DQT_SQL_LIB -
  55. DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_H
  56. AVE_SSE2 -DQT_THREAD_SUPPORT -I"c:\QtSDK\Desktop\Qt\4.7.4\mingw\include\QtCore"
  57. -I"c:\QtSDK\Desktop\Qt\4.7.4\mingw\include\QtSql" -I"c:\QtSDK\Desktop\Qt\4.7.4\m
  58. ingw\include" -I"c:\MySQL\include" -I"c:\QtSDK\Desktop\Qt\4.7.4\mingw\include\Ac
  59. tiveQt" -I"debug" -I"c:\QtSDK\Desktop\Qt\4.7.4\mingw\mkspecs\default" -o debug\q
  60. sql_mysql.o ..\..\..\sql\drivers\mysql\qsql_mysql.cpp
  61. C:\QtSDK\Desktop\Qt\4.7.4\mingw\bin\moc.exe -DUNICODE -DQT_LARGEFILE_SUPPORT -DQ
  62. T_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_DLL -DQT_PLUGIN -DQT_SQL_LIB -DQ
  63. T_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAV
  64. E_SSE2 -DQT_THREAD_SUPPORT -I"c:\QtSDK\Desktop\Qt\4.7.4\mingw\include\QtCore" -I
  65. "c:\QtSDK\Desktop\Qt\4.7.4\mingw\include\QtSql" -I"c:\QtSDK\Desktop\Qt\4.7.4\min
  66. gw\include" -I"c:\MySQL\include" -I"c:\QtSDK\Desktop\Qt\4.7.4\mingw\include\Acti
  67. veQt" -I"debug" -I"c:\QtSDK\Desktop\Qt\4.7.4\mingw\mkspecs\default" -D__GNUC__ -
  68. DWIN32 ..\..\..\sql\drivers\mysql\qsql_mysql.h -o debug\moc_qsql_mysql.cpp
  69. g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -
  70. DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_DLL -DQT_PLUGIN -DQT_SQL_LIB -
  71. DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_H
  72. AVE_SSE2 -DQT_THREAD_SUPPORT -I"c:\QtSDK\Desktop\Qt\4.7.4\mingw\include\QtCore"
  73. -I"c:\QtSDK\Desktop\Qt\4.7.4\mingw\include\QtSql" -I"c:\QtSDK\Desktop\Qt\4.7.4\m
  74. ingw\include" -I"c:\MySQL\include" -I"c:\QtSDK\Desktop\Qt\4.7.4\mingw\include\Ac
  75. tiveQt" -I"debug" -I"c:\QtSDK\Desktop\Qt\4.7.4\mingw\mkspecs\default" -o debug\m
  76. oc_qsql_mysql.o debug\moc_qsql_mysql.cpp
  77. windres -i qsqlmysqld_resource.rc -o debug\qsqlmysqld_resource_res.o --include-d
  78. ir=. -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_AS
  79. CII -DQT_DLL -DQT_PLUGIN -DQT_SQL_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNO
  80. W -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT
  81. g++ -mthreads -shared -Wl,--out-implib,debug\libqsqlmysqld4.a -o debug\qsqlmysql
  82. d4.dll debug/main.o debug/qsql_mysql.o debug/moc_qsql_mysql.o  -L"c:\QtSDK\Deskt
  83. op\Qt\4.7.4\mingw\lib" debug\qsqlmysqld_resource_res.o C:\MySQL\lib\opt\libmysql
  84. .lib-o -lQtSqld4 -lQtCored4
  85. g++: C:\MySQL\lib\opt\libmysql.lib-o: No such file or directory
  86. mingw32-make[1]: *** [debug\qsqlmysqld4.dll] Error 1
  87. mingw32-make[1]: Leaving directory `C:/QtSDK/QtSources/4.7.4/src/plugins/sqldriv
  88. ers/mysql'
  89. mingw32-make: *** [debug] Error 2
  90.  
  91. C:\QtSDK\QtSources\4.7.4\src\plugins\sqldrivers\mysql>

 Signature 

Regards,
Wim

Page  
1

  ‹‹ [SOLVED] Two sets of applications in SDK install?      [Solved] Error compiling 4.8.0 on Win7x64, VS2010 SP1 ››

You must log in to post a reply. Not a member yet? Register here!