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 installation for QT4.7 in windows 7

Mysql installation for QT4.7 in windows 7

Scheduled Pinned Locked Moved Installation and Deployment
4 Posts 4 Posters 4.3k 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.
  • D Offline
    D Offline
    debasishsahu4upp
    wrote on last edited by
    #1

    Hello,

    I'm using QT4.7.3 installed mysql 5.5 in windows 7 32bit. I need to install mysql for qt . I folled the following steps and found the error.

    @
    C:\QtSDK\QtSources\4.7.3\src\plugins\sqldrivers\mysql>qmake "INCLUDEPATH+=c:\Pro
    gram Files (x86)\MySQL\MySQL Server 5.5\include" "LIBS+=c:\Program Files (x86)\M
    ySQL\MySQL Server 5.5\lib\libmysql.lib" -o Makefile mysql.pro
    WARNING: (internal):1: Unescaped backslashes are deprecated.
    WARNING: (internal):1: Unescaped backslashes are deprecated.
    WARNING: (internal):1: Unescaped backslashes are deprecated.

    C:\QtSDK\QtSources\4.7.3\src\plugins\sqldrivers\mysql>mingw32-make
    mingw32-make -f Makefile.Debug
    mingw32-make[1]: Entering directory C:/QtSDK/QtSources/4.7.3/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"c:\QtSDK\Desktop\Qt\4.7.3\mingw\include\QtCore" -I"c:\QtSDK\Desktop\Qt\4.7.3\mingw\include\QtSql" -I"c:\QtSDK\Desktop\Qt\4.7.3\m ingw\include" -I"c:\Program" -I"Files" -I"(x86)\MySQL\MySQL" -I"Server" -I"5.5\i nclude" -I"c:\QtSDK\Desktop\Qt\4.7.3\mingw\include\ActiveQt" -I"debug" -I"c:\QtS DK\Desktop\Qt\4.7.3\mingw\mkspecs\default" -o debug\main.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 C:/QtSDK/QtSources/4.7.3/src/plugins/sqldriv
    ers/mysql'
    mingw32-make: *** [debug] Error 2@

    need some help urgent..

    Thanx

    1 Reply Last reply
    0
    • G Offline
      G Offline
      GroundZero
      wrote on last edited by
      #2

      I have this problem to and no one knows a solution ><

      1 Reply Last reply
      0
      • H Offline
        H Offline
        Hostel
        wrote on last edited by
        #3

        Spaces in path to MySql could make issue. Try something like this:

        1. create dir like C:\MySql_5.5
        2. copy include folder to new directory
        3. copy lib folder to new directory

        After this steps try run qmake, but with new directory in INCLUDEPATH and LIBS.

        1 Reply Last reply
        0
        • G Offline
          G Offline
          goetz
          wrote on last edited by
          #4

          This line is the root of the errors:

          @
          qmake "INCLUDEPATH+=c:\Program Files (x86)\MySQL\MySQL Server 5.5\include" "LIBS+=c:\Program Files (x86)\MySQL\MySQL Server 5.5\lib\libmysql.lib" -o Makefile mysql.pro
          @

          You will have to add quotes for paths containing spaces in it, otherwise qmake thinks it is actually two paths

          Always use forward slashes instead of backslashes, qmake translates it automagically to the version the platform needs.

          The LIBS variable should contain the directory containing the libraries, not the path the library itself (the .pro file already wants to link against it!). Prepend the path with -L.

          So, change your qmake call to:

          @
          qmake 'INCLUDEPATH+="c:/Program Files (x86)/MySQL/MySQL Server 5.5/include"' 'LIBS+=-Lc:/Program Files (x86)/MySQL/MySQL Server 5.5/lib'" -o Makefile mysql.pro
          @

          http://www.catb.org/~esr/faqs/smart-questions.html

          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