Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. [Solved] MySQL and Qt on Windows 7.
Forum Updated to NodeBB v4.3 + New Features

[Solved] MySQL and Qt on Windows 7.

Scheduled Pinned Locked Moved Qt Creator and other tools
3 Posts 2 Posters 7.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.
  • K Offline
    K Offline
    karhu44
    wrote on 15 Oct 2010, 07:55 last edited by
    #1

    Hi Everybody!

    I am struggling with connection of Qt program to MySQL database on Windows 7 operating system. I learned from the documentation ("http://doc.trolltech.com/4.6/sql-driver.html#qmysql-for-mysql-4-and-higher":http://doc.trolltech.com/4.6/sql-driver.html#qmysql-for-mysql-4-and-higher) that I have to build QMYSQL plug-in. OK. I succeeded to execute two commands from the command line:

    @
    cd %QTDIR%\src\plugins\sqldrivers\mysql
    qmake "INCLUDEPATH+=C:\MySQL\include" "LIBS+=C:\MYSQL\MySQL Server <version>\lib\opt\libmysql.lib" mysql.pro
    @

    However, the above presented qmake command is written in the form is presented in the documentation. This form is wrong. The correct one is as follow:

    @
    qmake "INCLUDEPATH+=C:\MySQL\include" "LIBS+=C:\MYSQL\MySQL Server <version>\lib\opt\libmysql.lib" mysql.pro
    C/C++ language string form!
    @

    Next, the documentation requires to run nmake command. The only nmake command I found is related to ... Visual Studio 10. Is this the one I should use?

    Best regards, Grzegorz

    [edit: fixed link and code markup / chetankjain]

    1 Reply Last reply
    0
    • T Offline
      T Offline
      tobias.hunger
      wrote on 15 Oct 2010, 20:10 last edited by
      #2

      Which compiler was used to build your Qt? This is either mingw or msvc. Mingw usually comes with its own make which I usually prefer to nmake. If your Qt was build with msvc, then nmake is fine.

      Of course you can also use "jom":ftp://ftp.qt.nokia.com/jom which usually is faster than nmake;-)

      1 Reply Last reply
      0
      • K Offline
        K Offline
        karhu44
        wrote on 15 Oct 2010, 20:54 last edited by
        #3

        Hi Tobias,

        I downloaded my Qt as executable from Nokia’s site, so I guess it was compiled with mingw.

        Thanks a lot for the tip and best regards,
        Grzegorz

        1 Reply Last reply
        0

        1/3

        15 Oct 2010, 07:55

        • Login

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