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. Qt 4.7.4, MySQL and Windows 7
Forum Updated to NodeBB v4.3 + New Features

Qt 4.7.4, MySQL and Windows 7

Scheduled Pinned Locked Moved Installation and Deployment
6 Posts 2 Posters 6.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.
  • T Offline
    T Offline
    tomi127
    wrote on 11 Oct 2011, 16:18 last edited by
    #1

    Hi all, i have problem with building MySQL database with QT on Windows. I trying 3 days but i cant do this. I have MySQL Connector C++ 1.1.0. I'm doing everything step-by-step from this site: http://www.pikopong.com/blog/2011/07/11/how-to-enable-mysql-support-in-qt-sdk-for-windows-part-2/
    I have first problem with command
    @qmake "INCLUDEPATH+=D:/PROGRA~1/MySQL/MYSQLC~1.0/include" "LIBS+=D:/PROGRA~1/MySQL/MYSQLC~1.0/lib/opt/mysqlcppconn.lib" -o Makefile mysql.pro@
    I dont have mysql.pro in the folder so i'm create a empty txt file and rename it to "mysql.pro". Now this command works, but i have big problem on mingw32-make command, i've got this: @mingw32-make -f Makefile.Debug
    mingw32-make[1]: Entering directory D:/QtSDK/Desktop/Qt/4.7.4/mingw/plugins/sql drivers/mysql' g++ -mthreads -Wl,-subsystem,windows -o debug\mysql.exe -L"d:\QtSDK\Desktop\Qt \4.7.4\mingw\lib" -lmingw32 -lqtmaind D:/PROGRA~1/MySQL/MYSQLC~1.0/lib/debug/mys qlcppconn.lib -lQtGuid4 -lQtCored4 -LC:\OpenSSL-Win32_full\lib d:\QtSDK\Desktop\Qt\4.7.4\mingw\lib/libqtmaind.a(qtmain_win.o): In function Win
    Main@16':
    c:/ndk_buildrepos/qt-desktop/src/winmain/qtmain_win.cpp:131: undefined reference
    to qMain(int, char**)' collect2: ld returned 1 exit status mingw32-make[1]: *** [debug\mysql.exe] Error 1 mingw32-make[1]: Leaving directory D:/QtSDK/Desktop/Qt/4.7.4/mingw/plugins/sqld
    rivers/mysql'
    mingw32-make: *** [debug] Error 2@
    So what i should do?

    Sorry for my bad english (or not? :P).

    1 Reply Last reply
    0
    • C Offline
      C Offline
      cincirin
      wrote on 12 Oct 2011, 06:46 last edited by
      #2

      [quote author="tomi127" date="1318349919"]I dont have mysql.pro in the folder ...
      mingw32-make[1]: Entering directory `D:/QtSDK/Desktop/Qt/4.7.4/mingw/plugins/sql
      drivers/mysql'[/quote]
      Your current directory is wrong. Change it to :
      d:\QtSDK\ QtSources \4.7.3\src\plugins\sqldrivers\mysql\

      1 Reply Last reply
      0
      • T Offline
        T Offline
        tomi127
        wrote on 12 Oct 2011, 15:11 last edited by
        #3

        Hi, thanks for Your reply. Unfortunately your method don't work. I don't have 'QtSources' folder. So I create folder and change the directory but i got the same error :(
        @mingw32-make -f Makefile.Debug
        mingw32-make[1]: Entering directory d:/QtSDK/QtSources/4.7.4/src/plugins/sqldri vers/mysql' g++ -mthreads -Wl,-subsystem,windows -o debug\mysql.exe -L"d:\QtSDK\Desktop\Qt \4.7.4\mingw\lib" -lmingw32 -lqtmaind D:/PROGRA~1/MySQL/MYSQLC~1.0/lib/opt/mysql cppconn.lib -lQtGuid4 -lQtCored4 -LC:\OpenSSL-Win32_full\lib d:\QtSDK\Desktop\Qt\4.7.4\mingw\lib/libqtmaind.a(qtmain_win.o): In function Win
        Main@16':
        c:/ndk_buildrepos/qt-desktop/src/winmain/qtmain_win.cpp:131: undefined reference
        to qMain(int, char**)' collect2: ld returned 1 exit status mingw32-make[1]: *** [debug\mysql.exe] Error 1 mingw32-make[1]: Leaving directory d:/QtSDK/QtSources/4.7.4/src/plugins/sqldriv
        ers/mysql'
        mingw32-make: *** [debug] Error 2@

        Any ideas?

        1 Reply Last reply
        0
        • C Offline
          C Offline
          cincirin
          wrote on 12 Oct 2011, 16:58 last edited by
          #4

          [quote author="tomi127" date="1318432267"]I don't have 'QtSources' folder. ... Any ideas?[/quote]
          When you install QtSDK, you must check Qt sources from Qt installer.

          1 Reply Last reply
          0
          • T Offline
            T Offline
            tomi127
            wrote on 13 Oct 2011, 21:12 last edited by
            #5

            @QSqlDatabase: available drivers: QSQLITE QMYSQL3 QMYSQL QPSQL7 QPSQL@
            Thanks a lot! If somebody can't build MySQL you CAN'T use MySQL C++ Connector. Just do exactly steps from link in post #1.

            I did some otherwise... and that was the reason of this subject.
            Sorry for problem.

            1 Reply Last reply
            0
            • C Offline
              C Offline
              cincirin
              wrote on 14 Oct 2011, 06:22 last edited by
              #6

              [quote author="tomi127" date="1318540350"]@If somebody can't build MySQL you CAN'T use MySQL C++ Connector.[/quote]
              What do you mean ? I use only "My SQL Connector/C++":http://www.mysql.com/downloads/connector/cpp/. It works with both VC and MinGW compilers.

              1 Reply Last reply
              0

              1/6

              11 Oct 2011, 16:18

              • Login

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