Page 1 of 2 12 LastLast
Results 1 to 20 of 25

Thread: I just don´t get the MySQL Driver Compiled

  1. #1
    Join Date
    Feb 2010
    Posts
    13
    Qt products
    Qt4
    Platforms
    Windows

    Default 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?

  2. #2
    Join Date
    Oct 2009
    Posts
    364
    Thanks
    10
    Thanked 37 Times in 36 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: I just don´t get the MySQL Driver Compiled

    Quote Originally Posted by alex04721 View Post
    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

  3. #3
    Join Date
    Feb 2010
    Posts
    13
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: I just don´t get the MySQL Driver Compiled

    Vielen dank schnitzel^^

    Thank you very much, ill try this out tomorrow.

  4. #4
    Join Date
    Oct 2009
    Posts
    364
    Thanks
    10
    Thanked 37 Times in 36 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default 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'.

  5. #5
    Join Date
    Feb 2010
    Posts
    13
    Qt products
    Qt4
    Platforms
    Windows

    Default 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?

  6. #6
    Join Date
    Oct 2009
    Posts
    364
    Thanks
    10
    Thanked 37 Times in 36 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: I just don´t get the MySQL Driver Compiled

    Quote Originally Posted by alex04721 View Post
    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

    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.
    Last edited by schnitzel; 26th February 2010 at 08:00.

  7. #7
    Join Date
    Feb 2010
    Posts
    13
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: I just don´t get the MySQL Driver Compiled

    I get

    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^^.
    Last edited by alex04721; 26th February 2010 at 09:09.

  8. #8
    Join Date
    Oct 2009
    Posts
    364
    Thanks
    10
    Thanked 37 Times in 36 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: I just don´t get the MySQL Driver Compiled

    Quote Originally Posted by alex04721 View Post

    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

  9. #9
    Join Date
    Feb 2010
    Posts
    13
    Qt products
    Qt4
    Platforms
    Windows

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

  10. #10
    Join Date
    Oct 2009
    Posts
    364
    Thanks
    10
    Thanked 37 Times in 36 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: I just don´t get the MySQL Driver Compiled

    Quote Originally Posted by alex04721 View Post
    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.

  11. #11
    Join Date
    Feb 2010
    Posts
    13
    Qt products
    Qt4
    Platforms
    Windows

    Default 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

  12. #12
    Join Date
    Oct 2009
    Posts
    364
    Thanks
    10
    Thanked 37 Times in 36 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: I just don´t get the MySQL Driver Compiled

    Quote Originally Posted by alex04721 View Post
    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).

  13. #13
    Join Date
    Feb 2010
    Posts
    13
    Qt products
    Qt4
    Platforms
    Windows

    Default 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^^

  14. #14
    Join Date
    Feb 2010
    Posts
    13
    Qt products
    Qt4
    Platforms
    Windows

    Default 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

    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

  15. #15
    Join Date
    Oct 2009
    Posts
    364
    Thanks
    10
    Thanked 37 Times in 36 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: I just don´t get the MySQL Driver Compiled

    Quote Originally Posted by alex04721 View Post
    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.
    Last edited by schnitzel; 1st March 2010 at 17:04.

  16. #16
    Join Date
    Oct 2009
    Posts
    364
    Thanks
    10
    Thanked 37 Times in 36 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: I just don´t get the MySQL Driver Compiled

    Quote Originally Posted by alex04721 View Post
    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?

  17. #17
    Join Date
    Feb 2010
    Posts
    13
    Qt products
    Qt4
    Platforms
    Windows

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


    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^^

    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:rimaryIndex(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>
    Last edited by alex04721; 2nd March 2010 at 07:23.

  18. #18
    Join Date
    Oct 2009
    Posts
    364
    Thanks
    10
    Thanked 37 Times in 36 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: I just don´t get the MySQL Driver Compiled

    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

  19. #19
    Join Date
    Feb 2010
    Posts
    13
    Qt products
    Qt4
    Platforms
    Windows

    Default 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
    Last edited by alex04721; 3rd March 2010 at 09:26.

  20. #20
    Join Date
    Oct 2009
    Posts
    364
    Thanks
    10
    Thanked 37 Times in 36 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: I just don´t get the MySQL Driver Compiled

    Quote Originally Posted by alex04721 View Post
    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?
    Last edited by schnitzel; 3rd March 2010 at 18:26.

Similar Threads

  1. I need MySQL driver for Qt 4.6, WindowsXP(32), MySQL 5.1
    By User_3 in forum Installation and Deployment
    Replies: 7
    Last Post: 15th October 2010, 15:19
  2. cant compile mysql driver
    By IsoArska in forum Newbie
    Replies: 18
    Last Post: 30th November 2009, 22:51
  3. Statically compiled Qt 4.1.4 and mySql
    By Djony in forum Installation and Deployment
    Replies: 1
    Last Post: 26th January 2007, 07:13
  4. Deployment of QT4 App that uses the MySql driver
    By kroenecker in forum Installation and Deployment
    Replies: 5
    Last Post: 20th June 2006, 08:52

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.