I just don´t get the MySQL Driver Compiled
AND YES I SEARCHED FOR IT AND JUST DON´T FIND WORKING MANUALS
I am new to this board so hello guys and girls^^, i have learned C++ and now want to continue with GUI Programming in QT but i have a problem with the MySQL drivers.
My OS is Windows XP Professional SP3 and i use QT 4.6 (2010.01)
i tried
I.
cd QTDIR\..\plugins\sqldrivers\mysql
qmake -o Makefile "INCLUDEPATH+=C:\MySQL\MySQL Server 5.1\include" "LIBS+=C:\MySQL\MySQL Server 5.1\lib\opt\libmysql.lib" mysql.pro
(nmake)
this is the manual from the QT Documentation, it didn´t work. it works fine until qmake, then i typed in(into the command prompt) "nmake" and it tells me nmake is not a valid command, i also tried make but this one´s too invalid.
i too tried something from the QT Wiki, it doesnt work too. However WIKI is not available ATM.
someone can help me please?
Re: I just don´t get the MySQL Driver Compiled
Quote:
Originally Posted by
alex04721
AND YES I SEARCHED FOR IT AND JUST DON´T FIND WORKING MANUALS
I am new to this board so hello guys and girls^^, i have learned C++ and now want to continue with GUI Programming in QT but i have a problem with the MySQL drivers.
My OS is Windows XP Professional SP3 and i use QT 4.6 (2010.01)
i tried
I.
cd QTDIR\..\plugins\sqldrivers\mysql
qmake -o Makefile "INCLUDEPATH+=C:\MySQL\MySQL Server 5.1\include" "LIBS+=C:\MySQL\MySQL Server 5.1\lib\opt\libmysql.lib" mysql.pro
(nmake)
this is the manual from the QT Documentation, it didn´t work. it works fine until qmake, then i typed in(into the command prompt) "nmake" and it tells me nmake is not a valid command, i also tried make but this one´s too invalid.
i too tried something from the QT Wiki, it doesnt work too. However WIKI is not available ATM.
someone can help me please?
First of all, your paths for mysql contain spaces which will cause problems (at least that's the case with previous version of Qt). Instead copy lib and include files to something like 'c:\mysql\lib' and 'c:\mysql\include'.
Next, I assume you have the sdk that includes mingw, which means that any references to make or nmake should be replaced with mingw32-make. Documentation regarding this point could be a bit clearer in my opinion.
good luck
Re: I just don´t get the MySQL Driver Compiled
Vielen dank schnitzel^^
Thank you very much, ill try this out tomorrow.
Re: I just don´t get the MySQL Driver Compiled
forgot to mention that you can also use short path names (8 character filename, 3 character extension) which can be obtained by 'dir /x'.
Re: I just don´t get the MySQL Driver Compiled
I did this
cd QTDIR\..\plugins\sqldrivers\mysql
qmake -o Makefile "INCLUDEPATH+=C:\MySQL\include" "LIBS+=C:\MySQL\lib\opt\libmysql.lib" mysql.pro
mingw32-make
everything went fine. what to do next?
Re: I just don´t get the MySQL Driver Compiled
Quote:
Originally Posted by
alex04721
I did this
cd QTDIR\..\plugins\sqldrivers\mysql
qmake -o Makefile "INCLUDEPATH+=C:\MySQL\include" "LIBS+=C:\MySQL\lib\opt\libmysql.lib" mysql.pro
mingw32-make
everything went fine. what to do next?
so, you didn't get any error messages from the mingw32-make command? Well then congrats :D
Now you have to start using it. I think you just have to 'mingw32-make install' which will put the plugin in the right place.
Look at the Makefile where it goes.
Then write a little testapp to use mysql and see if the driver loads.
Re: I just don´t get the MySQL Driver Compiled
I get
Quote:
G:\Qt\2010.01\qt\src\plugins\sqldrivers\mysql>ming w32-make install
mingw32-make -f Makefile.Debug install
mingw32-make[1]: Entering directory `G:/Qt/2010.01/qt/src/plugins/sqldrivers/mys
ql'
copy /y "..\..\..\..\plugins\sqldrivers\qsqlmysqld4.dl l" "g:\Qt\2010.01\qt\plugi
ns\sqldrivers\qsqlmysqld4.dll"
Die Datei kann nicht in sich selbst kopiert werden.
0 Datei(en) kopiert.
mingw32-make[1]: [install_target] Error 1 (ignored)
mingw32-make[1]: Leaving directory `G:/Qt/2010.01/qt/src/plugins/sqldrivers/mysq
l'
mingw32-make -f Makefile.Release install
mingw32-make[1]: Entering directory `G:/Qt/2010.01/qt/src/plugins/sqldrivers/mys
ql'
copy /y "..\..\..\..\plugins\sqldrivers\qsqlmysql4.dll " "g:\Qt\2010.01\qt\plugin
s\sqldrivers\qsqlmysql4.dll"
Die Datei kann nicht in sich selbst kopiert werden.
0 Datei(en) kopiert.
mingw32-make[1]: [install_target] Error 1 (ignored)
mingw32-make[1]: Leaving directory `G:/Qt/2010.01/qt/src/plugins/sqldrivers/mysq
l'
Die Datei kann nicht in sich selbst kopiert werden. - The file cannot be copied in to itself
0 Datei(en) kopiert - 0 files copied
Well i try it again beginning with the reimnp and then the qmake
edit: ive tried it again and receive the same errors, i have been very carefully so i don´t make mistakes. But thank you, at least i´m coming forward a little bit^^.
Re: I just don´t get the MySQL Driver Compiled
Quote:
Originally Posted by
alex04721
Well i try it again beginning with the reimnp and then the qmake
edit: ive tried it again and receive the same errors, i have been very carefully so i don´t make mistakes. But thank you, at least i´m coming forward a little bit^^.
You shouldn't have to use reimp and it looks like the dlls might have been copied to the proper place already by the make step.
..\qt\plugins\sqldrivers\qsqlmysqld4.dll is the proper location and if that file exists you are set.
good luck
Re: I just don´t get the MySQL Driver Compiled
no, really there arent any dll files in my plugins\sqldrivers\mysql dir, i also still can´t connect to a mysql database.
Re: I just don´t get the MySQL Driver Compiled
Quote:
Originally Posted by
alex04721
no, really there arent any dll files in my plugins\sqldrivers\mysql dir, i also still can´t connect to a mysql database.
you are doing all this from a Qt command prompt - right?
try mingw32-make clean and then make again. I just tried it again and the libs gets created in the right place by the mingw32-make command, i.e. no need to run install.
Re: I just don´t get the MySQL Driver Compiled
yes i do. mingw32-make clean doesnt work too. if you say it should run, something must be wrong with my qt or something. :( he still says he cant create the dll files becauser he cant copy them into himself but there are no dll files
Re: I just don´t get the MySQL Driver Compiled
Quote:
Originally Posted by
alex04721
yes i do. mingw32-make clean doesnt work too. if you say it should run, something must be wrong with my qt or something. :( he still says he cant create the dll files becauser he cant copy them into himself but there are no dll files
hmmm - sounds like your environment is messed up. Just copy them manually from the src tree to where they belong.
Alternatively, try reinstalling Qt.
From a fresh install of the binary installer, it will hopefully work right away, provided you use the Qt Command Prompt (you never mentioned that you did actually use this).
Re: I just don´t get the MySQL Driver Compiled
sorry, i have used the qt command prompt for everything you told me. I will tryout a reinstall tommorrow, thank you very much for your help^^
Re: I just don´t get the MySQL Driver Compiled
it still isnt working, if i try mingw32-make install i get this again
i have reinstalled qt some times, i have no idea why its not runnig
Quote:
G:\Qt\2010.01\qt\src\plugins\sqldrivers\mysql>ming w32-make install
mingw32-make -f Makefile.Debug install
mingw32-make[1]: Entering directory `G:/Qt/2010.01/qt/src/plugins/sqldrivers/mys
ql'
copy /y "..\..\..\..\plugins\sqldrivers\qsqlmysqld4.dl l" "g:\Qt\2010.01\qt\plugi
ns\sqldrivers\qsqlmysqld4.dll"
Die Datei kann nicht in sich selbst kopiert werden.
0 Datei(en) kopiert.
mingw32-make[1]: [install_target] Error 1 (ignored)
mingw32-make[1]: Leaving directory `G:/Qt/2010.01/qt/src/plugins/sqldrivers/mysq
l'
mingw32-make -f Makefile.Release install
mingw32-make[1]: Entering directory `G:/Qt/2010.01/qt/src/plugins/sqldrivers/mys
ql'
copy /y "..\..\..\..\plugins\sqldrivers\qsqlmysql4.dll " "g:\Qt\2010.01\qt\plugin
s\sqldrivers\qsqlmysql4.dll"
Die Datei kann nicht in sich selbst kopiert werden.
0 Datei(en) kopiert.
mingw32-make[1]: [install_target] Error 1 (ignored)
mingw32-make[1]: Leaving directory `G:/Qt/2010.01/qt/src/plugins/sqldrivers/mysq
l'
Die Datei kann nicht in sich selbst kopiert werden. - The file cannot be copied in to itself
0 Datei(en) kopiert - 0 files copied
Re: I just don´t get the MySQL Driver Compiled
Quote:
Originally Posted by
alex04721
it still isnt working, if i try mingw32-make install i get this again
i have reinstalled qt some times, i have no idea why its not runnig
I'm sorry I ever mentioned the mingw32-make install part... it is NOT needed. Just mingw32-make should do the trick.
First run 'mingw32-make clean', then show us the entire console log of the 'mingw32-make' command, but please WITHOUT the 'install'. I'd like to see the entire thing.
I know you must be getting quite frustrated, but hang in there.
Re: I just don´t get the MySQL Driver Compiled
Quote:
Originally Posted by
alex04721
it still isnt working, if i try mingw32-make install i get this again
i have reinstalled qt some times, i have no idea why its not runnig
I'm also wondering if there could be some permission problem here - why do you install into G drive? Is that some network drive?
Re: I just don´t get the MySQL Driver Compiled
thats a long story, in short i have only 20GB on C: Harddrive(the g drive is LOCAL and i am admin of this PC). But i tried this on another Computer too with same results. I guess i´ll try an older version of QT and look what happens.
Quote:
First run 'mingw32-make clean', then show us the entire console log of the 'mingw32-make' command, but please WITHOUT the 'install'. I'd like to see the entire thing.
I know you must be getting quite frustrated, but hang in there.
ok, thanks. i´ll do this now
here it is^^
Quote:
G:\Qt\qt\src\plugins\sqldrivers\mysql>qmake -o Makefile "INCLUDEPATH+=C:\MySQL\i
nclude" "LIBS+=C:\MySQL\lib\opt\libmysql.lib" mysql.pro
G:\Qt\qt\src\plugins\sqldrivers\mysql>mingw32-make
mingw32-make -f Makefile.Release
mingw32-make[1]: Entering directory `G:/Qt/qt/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_NO_DEBUG -DQT_STATICPLUGIN -D
QT_PLUGIN -DQT_SQL_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -I"..\..\..\..\include\
QtCore" -I"..\..\..\..\include\QtSql" -I"..\..\..\..\include" -I"c:\mysql\includ
e" -I"c:\MySQL\include" -I"..\..\..\..\include\ActiveQt" -I"tmp\moc\release_stat
ic" -I"..\..\..\..\mkspecs\win32-g++" -o tmp\obj\release_static\main.o main.cpp
G:/Qt/qt/bin/moc.exe -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_NO_CAST_TO_ASCII -DQT
_NO_CAST_FROM_ASCII -DQT_NO_DEBUG -DQT_STATICPLUGIN -DQT_PLUGIN -DQT_SQL_LIB -DQ
T_CORE_LIB -DQT_THREAD_SUPPORT -I"..\..\..\..\include\QtCore" -I"..\..\..\..\inc
lude\QtSql" -I"..\..\..\..\include" -I"c:\mysql\include" -I"c:\MySQL\include" -I
"..\..\..\..\include\ActiveQt" -I"tmp\moc\release_static" -I"..\..\..\..\mkspecs
\win32-g++" -D__GNUC__ -DWIN32 ..\..\..\sql\drivers\mysql\qsql_mysql.cpp -o tmp\
moc\release_static\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_NO_DEBUG -DQT_STATICPLUGIN -D
QT_PLUGIN -DQT_SQL_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -I"..\..\..\..\include\
QtCore" -I"..\..\..\..\include\QtSql" -I"..\..\..\..\include" -I"c:\mysql\includ
e" -I"c:\MySQL\include" -I"..\..\..\..\include\ActiveQt" -I"tmp\moc\release_stat
ic" -I"..\..\..\..\mkspecs\win32-g++" -o tmp\obj\release_static\qsql_mysql.o ..\
..\..\sql\drivers\mysql\qsql_mysql.cpp
..\..\..\sql\drivers\mysql\qsql_mysql.cpp: In member function 'virtual QSqlIndex
QMYSQLDriver::primaryIndex(const QString&) const':
..\..\..\sql\drivers\mysql\qsql_mysql.cpp:1368: warning: unused variable 'prepQ'
G:/Qt/qt/bin/moc.exe -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_NO_CAST_TO_ASCII -DQT
_NO_CAST_FROM_ASCII -DQT_NO_DEBUG -DQT_STATICPLUGIN -DQT_PLUGIN -DQT_SQL_LIB -DQ
T_CORE_LIB -DQT_THREAD_SUPPORT -I"..\..\..\..\include\QtCore" -I"..\..\..\..\inc
lude\QtSql" -I"..\..\..\..\include" -I"c:\mysql\include" -I"c:\MySQL\include" -I
"..\..\..\..\include\ActiveQt" -I"tmp\moc\release_static" -I"..\..\..\..\mkspecs
\win32-g++" -D__GNUC__ -DWIN32 ..\..\..\sql\drivers\mysql\qsql_mysql.h -o tmp\mo
c\release_static\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_NO_DEBUG -DQT_STATICPLUGIN -D
QT_PLUGIN -DQT_SQL_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -I"..\..\..\..\include\
QtCore" -I"..\..\..\..\include\QtSql" -I"..\..\..\..\include" -I"c:\mysql\includ
e" -I"c:\MySQL\include" -I"..\..\..\..\include\ActiveQt" -I"tmp\moc\release_stat
ic" -I"..\..\..\..\mkspecs\win32-g++" -o tmp\obj\release_static\moc_qsql_mysql.o
tmp\moc\release_static\moc_qsql_mysql.cpp
ar -ru ..\..\..\..\plugins\sqldrivers\libqsqlmysql.a tmp/obj/release_static/main
.o tmp/obj/release_static/qsql_mysql.o tmp/obj/release_static/moc_qsql_mysql.o
mingw32-make[1]: Leaving directory `G:/Qt/qt/src/plugins/sqldrivers/mysql'
G:\Qt\qt\src\plugins\sqldrivers\mysql>
Re: I just don´t get the MySQL Driver Compiled
Quote:
ar -ru ..\..\..\..\plugins\sqldrivers\libqsqlmysql.a tmp/obj/release_static/main
.o tmp/obj/release_static/qsql_mysql.o tmp/obj/release_static/moc_qsql_mysql.o
according to the above, the plugin was built - can you try to locate the file libqsqlmysql.a
Re: I just don´t get the MySQL Driver Compiled
i have searched my entire HDD with Windows but there is no file called 'libqsqlmysql.a'
something is wrong, but what XD im am brainwashed
Re: I just don´t get the MySQL Driver Compiled
Quote:
Originally Posted by
alex04721
i have searched my entire HDD with Windows but there is no file called 'libqsqlmysql.a'
something is wrong, but what XD im am brainwashed
G:/Qt isn't the default location. Did you move the folder after installation perhaps or did you specify different location during installation?
Look at the build log, from the folder G:/Qt/qt/src/plugins/sqldrivers/mysql the makefile is trying to create: ..\..\..\..\plugins\sqldrivers\libqsqlmysql.a
so this file should be at G:/Qt/plugins/sqldrivers/. Please tell me the files that are in this folder.
f it isn't there then look on the C: drive.
Can you try installing to default location?