Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. MySQL + Qt4 + Windows7 = problems [SOLVED]
Forum Updated to NodeBB v4.3 + New Features

MySQL + Qt4 + Windows7 = problems [SOLVED]

Scheduled Pinned Locked Moved Installation and Deployment
5 Posts 4 Posters 5.0k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    sibqaai
    wrote on last edited by
    #1

    Hello!

    First of all, I'm kinda new to Qt, and especially to MySQL,
    so sorry if I did newbie mistakes, but I cannot solve it by myself.

    I met some problems, while I wanted to set up MySQL for my Qt4.
    I did exactly the discibed steps, from for eg:
    http://ieatbinary.com/2011/07/11/how-to-enable-mysql-support-in-qt-sdk-for-windows/
    and
    http://qt-project.org/forums/viewthread/15405/ ( they had errors at this point too )

    I installed the last QtSources, I downloaded and installed "mysql-5.5.23-win32", from the MySQL's homepage.

    And I successfully did the first few steps, and then I got some wild errors after the "mingw32-make" command.

    D:\QtSDK\QtSources\4.8.1\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.
    d:\QtSDK\QtSources\4.8.1\src\plugins\sqldrivers\mysql\Makefile:9: Parse Error ('
    first: release')
    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.

    D:\QtSDK\QtSources\4.8.1\src\plugins\sqldrivers\mysql>mingw32-make
    mingw32-make -f Makefile.Debug
    mingw32-make[1]: Entering directory D:/QtSDK/QtSources/4.8.1/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"d:\QtSDK\Desktop\Qt\4.8.0\mingw\include\QtCore" -I"d:\QtSDK\Desktop\Qt\4.8.0\mingw\include\QtSql" -I"d:\QtSDK\Desktop\Qt\4.8.0\m ingw\include" -I"d:\MySQL\include" -I"d:\QtSDK\Desktop\Qt\4.8.0\mingw\include\Ac tiveQt" -I"debug" -I"d:\QtSDK\Desktop\Qt\4.8.0\mingw\mkspecs\default" -o debug\m ain.o main.cpp In file included from main.cpp:44: ../../../sql/drivers/mysql/qsql_mysql.h:52:19: error: mysql.h: No such file or d irectory In file included from main.cpp:44: ../../../sql/drivers/mysql/qsql_mysql.h:108: error: expected ')' before '*' toke n mingw32-make[1]: *** [debug/main.o] Error 1 mingw32-make[1]: Leaving directory D:/QtSDK/QtSources/4.8.1/src/plugins/sqldriv
    ers/mysql'
    mingw32-make: *** [debug] Error 2

    I couldn't find any solutions on the internet.
    Does anyone have any idea, why it can't find mysql.h? ( It is in the MySQL's directory, so... )

    Sincerely,
    SB

    1 Reply Last reply
    0
    • K Offline
      K Offline
      koahnig
      wrote on last edited by
      #2

      welcome to devnet

      As it looks you have already errors a step earlier. The qmake does have an error message you need to follow up.

      @
      D:\QtSDK\QtSources\4.8.1\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.
      d:\QtSDK\QtSources\4.8.1\src\plugins\sqldrivers\mysql\Makefile:9: Parse Error (’
      first: release’)
      Error processing project file: Makefile
      @

      Vote the answer(s) that helped you to solve your issue(s)

      1 Reply Last reply
      0
      • S Offline
        S Offline
        sibqaai
        wrote on last edited by
        #3

        Ok, I think I found out what was the problem.

        Koahnig, thank you for the advice, but those werent serious problems. I ignored all the warnings about backslashes ( why should I \ if it is a path... ).

        The main reason was the path of mysql directory.
        mysql="D:\MySQL\MYSQLS~1.5" was the solution. When I used the mysql variable withot the quotes, it didn't want to work. Maybe the reason is, it is a simple string.

        I googled all day long, and I couldn't find any solution, while a LOT of people are having the same problem... So, if you have this problem, I suggest you, to try it: While using, Start -> QtSDK -> Desktop -> Qt 4.8.0 for Desktop (MinGW)
        Obviously edit it, as your installation paths.

        1. ) > cd D:\MySQL\

        2.) D:\MySQL> dir /x

        Directory of D:\MySQL

        2012.04.15. 18:55 <DIR> .
        2012.04.15. 18:55 <DIR> ..
        2012.04.15. 18:55 <DIR> MYSQLS~1.5 MySQL
        0 File(s) 0 bytes
        3 Dir(s) 169 148 235 776 bytes free

        3.) > mysql="D:\MySQL\MYSQLS~1.5"
        4.) > cd
        5.) > cd QtSDK\QtSources\4.7.3\src\plugins\sqldrivers\mysql\

        6.) > qmake "INCLUDEPATH+=%mysql%\include" "LIBS+=%mysql%\lib\libmysql.lib" -o Makefile mysql.pro
        7.) > mingw32-make

        8.) > qmake "INCLUDEPATH+=%mysql%\include" "LIBS+=%mysql%\lib\libmysql.lib" -o Makefile mysql.pro "CONFIG+=release"
        9.) > mingw32-make

        It worked for me.

        Sincerely,
        SB

        1 Reply Last reply
        0
        • A Offline
          A Offline
          andre
          wrote on last edited by
          #4

          Using forward slashes on all platforms also solves this issue.

          1 Reply Last reply
          0
          • G Offline
            G Offline
            GentooXativa
            wrote on last edited by
            #5

            Remember to change the topic title to [SOLVED] ^_^

            Jose Vicente Giner Sanchez - Senior Mobile Developer

            www.gigigo.com

            C/ Dr. Zamenhof 36bis, 1ºA 28027 Madrid
            T: +34 917431436

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved