Re: Huge problems while installing QMYSQL driver
Hi All,
This is finally out of my hands. I give up. I find it too difficult to do it.
On WIndows 7 64bit with installed QtSDK 1.2.1, I tried to build the module QMYSQL. I though I could find it while running QtSDK package installer / updater but none of this is available from there. After digging in google, I found this article. The instructions does not match what can be found after installing MySql Server 5.5.27. There is no directory like "opt" in <path to Mysql>\lib\" folder. It was however the least problem along with I found also following issues:
* backslashes need to be escaped -- not mentioned on websit, e.g. C:\\Program Files\\Mysql\\Mysql Server 5.5.27\\..." etc. Otherwise qmake warns about it
* include and lib folders have to be copied into any folder outside C:\Program Files or C:\Program Files(86)\ or any system-like folders; they seem to be protected from accessing--I am guessing it but I ended up with this conclusion when I couldn't even start compilation because mysql.h couldn't be found even though I have specified the exact path.
After figuring out these issues, I finally kicked off and made "make" started working but it cannot finish it. I wanted to have the released version so I run command:
and got this log:
Code:
make -f Makefile.Release
make[1]: Entering directory `C:/QtSDK/QtSources/4.8.1/src/plugins/sqldrivers/mysql'
g++ -c -O2 -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_DLL -DQT_NO_DEBUG -DQT_PLUGIN -DQT_SQL_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\include\QtCore" -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\include\QtSql" -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\include" -I"include" -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\include\ActiveQt" -I"release" -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\mkspecs\default" -o release\main.o main.cpp
C:\QtSDK\Desktop\Qt\4.8.1\mingw\bin\moc.exe -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_DLL -DQT_NO_DEBUG -DQT_PLUGIN -DQT_SQL_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\include\QtCore" -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\include\QtSql" -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\include" -I"include" -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\include\ActiveQt" -I"release" -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\mkspecs\default" -D__GNUC__ -DWIN32 ..\..\..\sql\drivers\mysql\qsql_mysql.cpp -o release\qsql_mysql.moc
g++ -c -O2 -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_DLL -DQT_NO_DEBUG -DQT_PLUGIN -DQT_SQL_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\include\QtCore" -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\include\QtSql" -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\include" -I"include" -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\include\ActiveQt" -I"release" -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\mkspecs\default" -o release\qsql_mysql.o ..\..\..\sql\drivers\mysql\qsql_mysql.cpp
C:\QtSDK\Desktop\Qt\4.8.1\mingw\bin\moc.exe -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_DLL -DQT_NO_DEBUG -DQT_PLUGIN -DQT_SQL_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\include\QtCore" -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\include\QtSql" -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\include" -I"include" -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\include\ActiveQt" -I"release" -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\mkspecs\default" -D__GNUC__ -DWIN32 ..\..\..\sql\drivers\mysql\qsql_mysql.h -o release\moc_qsql_mysql.cpp
g++ -c -O2 -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_DLL -DQT_NO_DEBUG -DQT_PLUGIN -DQT_SQL_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\include\QtCore" -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\include\QtSql" -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\include" -I"include" -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\include\ActiveQt" -I"release" -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\mkspecs\default" -o release\moc_qsql_mysql.o release\moc_qsql_mysql.cpp
windres -i qsqlmysql_resource.rc -o release\qsqlmysql_resource_res.o --include-dir=. -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_DLL -DQT_NO_DEBUG -DQT_PLUGIN -DQT_SQL_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT
g++ -Wl,-s -mthreads -shared -Wl,--out-implib,release\libqsqlmysql4.a -o release\qsqlmysql4.dll release/main.o release/qsql_mysql.o release/moc_qsql_mysql.o -L"c:\QtSDK\Desktop\Qt\4.8.1\mingw\lib" release\qsqlmysql_resource_res.o -lmysql.lib -lQtSql4 -lQtCore4
c:/mingw/bin/../lib/gcc/mingw32/4.7.0/../../../../mingw32/bin/ld.exe: cannot find -lmysql.lib
collect2.exe: error: ld returned 1 exit status
make[1]: *** [release\qsqlmysql4.dll] Error 1
make[1]: Leaving directory `C:/QtSDK/QtSources/4.8.1/src/plugins/sqldrivers/mysql'
make: *** [release] Error 2
I though I could use nmake but got similar error:
Code:
'C:\Program' is not recognized as an internal or external command,
operable program or batch file.
C:\QtSDK\QtSources\4.8.1\src\plugins\sqldrivers\mysql>"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\amd64\nmake"
Microsoft (R) Program Maintenance Utility Version 10.00.30319.01
Copyright (C) Microsoft Corporation. All rights reserved.
"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\amd64\nmake.exe" -f Makefile.Debug
Microsoft (R) Program Maintenance Utility Version 10.00.30319.01
Copyright (C) Microsoft Corporation. All rights reserved.
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_HAVE_SSE2 -DQT_THREAD_SUPPORT -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\include\QtCore" -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\include\QtSql" -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\include" -I"include" -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\include\ActiveQt" -I"debug" -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\mkspecs\default" -o debug\main.o main.cpp
C:\QtSDK\Desktop\Qt\4.8.1\mingw\bin\moc.exe -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_HAVE_SSE2 -DQT_THREAD_SUPPORT -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\include\QtCore" -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\include\QtSql" -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\include" -I"include" -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\include\ActiveQt" -I"debug" -I"c:\QtSDK\Desktop\Qt\4.8.1\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_HAVE_SSE2 -DQT_THREAD_SUPPORT -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\include\QtCore" -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\include\QtSql" -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\include" -I"include" -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\include\ActiveQt" -I"debug" -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\mkspecs\default" -o debug\qsql_mysql.o ..\..\..\sql\drivers\mysql\qsql_mysql.cpp
C:\QtSDK\Desktop\Qt\4.8.1\mingw\bin\moc.exe -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_HAVE_SSE2 -DQT_THREAD_SUPPORT -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\include\QtCore" -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\include\QtSql" -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\include" -I"include" -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\include\ActiveQt" -I"debug" -I"c:\QtSDK\Desktop\Qt\4.8.1\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_HAVE_SSE2 -DQT_THREAD_SUPPORT -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\include\QtCore" -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\include\QtSql" -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\include" -I"include" -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\include\ActiveQt" -I"debug" -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\mkspecs\default" -o debug\moc_qsql_mysql.o debug\moc_qsql_mysql.cpp
windres -i qsqlmysqld_resource.rc -o debug\qsqlmysqld_resource_res.o --include-dir=. -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_HAVE_SSE2 -DQT_THREAD_SUPPORT
g++ -mthreads -shared -Wl,--out-implib,debug\libqsqlmysqld4.a -o debug\qsqlmysqld4.dll debug/main.o debug/qsql_mysql.o debug/moc_qsql_mysql.o -L"c:\QtSDK\Desktop\Qt\4.8.1\mingw\lib" debug\qsqlmysqld_resource_res.o -lmysql.lib -lQtSqld4 -lQtCored4
c:/mingw/bin/../lib/gcc/mingw32/4.7.0/../../../../mingw32/bin/ld.exe: cannot find -lmysql.lib
collect2.exe: error: ld returned 1 exit status
NMAKE : fatal error U1077: 'C:\MinGW\bin\g++.EXE' : return code '0x1'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\amd64\nmake.exe"' : return code '0x2'
Stop.
As you can see, there is still missing the same file "mysql.lib". I tried "make", "make debug" etc. but it did not help.
I don't know where to find it. In neither of these downloaded following files: ZIP archive of MySql 5.5.27 (32,64 bit), ZIP archive with connector/C, MSI installer with option "complete" of MySql 5.5.27 I could find it.
This is really overwhelming me. I am not advanced programmer. I am not even intermediate programmer. So far, I found Qt so well documented but not this. The procedure in the website I have provided link to is for pretty much highly skilled people who are experienced in Unix-like systems. QMYSQL should be installed via the installer, especially in QtSDK that supposed to be for beginners. Also, MySql is one of the most popular engine and for free.
I hope someone can help here.
Regards.
Re: Huge problems while installing QMYSQL driver
Check if you have the lmysql.lib , and try to enter the path of that library in your system PATH.
Edit, not read the last line, seems that you have to compile mysql by your self... Or check if you have a libmysql.lib and make a copy named lmysql.lib and add this to your path...
Re: Huge problems while installing QMYSQL driver
Quote:
Originally Posted by
RoyBellingan
Check if you have the lmysql.lib , and try to enter the path of that library in your system PATH.
Edit, not read the last line, seems that you have to compile mysql by your self...
Hi,
There's no such file like mysql.lib or lmysql.lib. BTW, isn't it the option "-l" and the argument "mysql.lib"?
Re: Huge problems while installing QMYSQL driver
Hi,
Could someone please direct me how to search to solve the problem? I know it's stupid question but I googled it a lot but did not come across any solution on that particular issue. I am quite beginner regarding static and dynamic library and this is the first time I am trying to build a module. At the moment, I know what the difference between libraries is but this is still nit enough. I read about GNU Make to try to understand how the module is to build or how the application is built at all. I think I followed that. However, it is still overwhelming, although I am slowly progressing. The thing is that I am sure someone with a good experience could provide some clues about what one would do when facing things like this.
Thanks.
Re: Huge problems while installing QMYSQL driver
I managed to build qsqlmysql4.dll, qsqlmysqld4.dll. I copied them to C:\QtSDK\Desktop\Qt\4.8.1\mingw\plugins\sqldrivers and then libmysql.dll to C:\QtSDK\Desktop\Qt\4.8.1\mingw\bin but Qt still cannot find QMYSQL driver. I followed the instructions in Qt Project but it does not work.