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. I am not able to build Qt MySql Driver on windows.

I am not able to build Qt MySql Driver on windows.

Scheduled Pinned Locked Moved Installation and Deployment
10 Posts 3 Posters 3.4k 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.
  • M Offline
    M Offline
    mmallad
    wrote on last edited by
    #1

    Hello,
    I am not able to build Qt MYSQL driver on windows. SO I am using QODBC. Also how to ship it with installation file.

    Dpak Malla

    1 Reply Last reply
    0
    • Q Offline
      Q Offline
      qxoz
      wrote on last edited by
      #2

      Why you can't build it? What error it shows?
      You can ship dlls with exe.

      1 Reply Last reply
      0
      • M Offline
        M Offline
        mmallad
        wrote on last edited by
        #3

        ya I have shipped dll with exe but it did not work at all.

        "I have tried to build QMYSQL driver with this":http://qt-project.org/doc/qt-4.8/sql-driver.html

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

        everything goes right except nmake. "namke not found"

        [quote author="qxoz" date="1362115930"]Why you can't build it? What error it shows?
        You can ship dlls with exe.[/quote]

        Dpak Malla

        1 Reply Last reply
        0
        • Q Offline
          Q Offline
          qxoz
          wrote on last edited by
          #4

          Your Qt is for MSVS or MinGw?
          Anyway you can open mysql.pro with QtCreator and build it there.
          Try put plugin dlls in sqldrivers folder beside *.exe

          1 Reply Last reply
          0
          • M Offline
            M Offline
            mmallad
            wrote on last edited by
            #5

            its for MinGw
            [quote author="qxoz" date="1362119342"]Your Qt is for MSVS or MinGw?
            Anyway you can open mysql.pro with QtCreator and build it there.
            Try put plugin dlls in sqldrivers folder beside *.exe[/quote]

            Dpak Malla

            1 Reply Last reply
            0
            • Q Offline
              Q Offline
              qxoz
              wrote on last edited by
              #6

              Just buld it from QtCreator.
              nmake is for MSVS compiler.

              1 Reply Last reply
              0
              • M Offline
                M Offline
                mmallad
                wrote on last edited by
                #7

                Oh thank you. One more thing.
                I have created several DLL for my project when i compile them using MSVS than it wont work when i use it as shared library in my project. But When i compile using mingw than it works.
                What may be the possible reason for this.

                Dpak Malla

                1 Reply Last reply
                0
                • Q Offline
                  Q Offline
                  qxoz
                  wrote on last edited by
                  #8

                  If you use Qt for MinGW then all your plugins(dlls) must be compiled with MinGW. MSVS and MinGW builds are not binary compatible.

                  1 Reply Last reply
                  0
                  • W Offline
                    W Offline
                    wakeuky
                    wrote on last edited by
                    #9

                    I recommend you check this link out:
                    http://seppemagiels.com/blog/create-mysql-driver-qt5-windows

                    I fought and fought configuring and building Qt with a MySQL plugin and eventually ended up doing the same thing you are doing - using QODBC driver. Unfortunately I had the same deployment problems you are facing - requiring that every deployment machine have MySQL ODBC connector installed and setup. Not a huge pain for one machine, but certainly for multiple.

                    To ensure I included all of the correct DLL libraries I used dependency walker:
                    http://www.dependencywalker.com/

                    On some target deployment machines (using ODBC) I had to include the SQLDRIVERS folder in the deployed application root directory.

                    Hope that helps, goodluck!

                    Don't Panic

                    1 Reply Last reply
                    0
                    • M Offline
                      M Offline
                      mmallad
                      wrote on last edited by
                      #10

                      Thank You :)
                      [quote author="wakeuky" date="1362151167"]I recommend you check this link out:
                      http://seppemagiels.com/blog/create-mysql-driver-qt5-windows

                      I fought and fought configuring and building Qt with a MySQL plugin and eventually ended up doing the same thing you are doing - using QODBC driver. Unfortunately I had the same deployment problems you are facing - requiring that every deployment machine have MySQL ODBC connector installed and setup. Not a huge pain for one machine, but certainly for multiple.

                      To ensure I included all of the correct DLL libraries I used dependency walker:
                      http://www.dependencywalker.com/

                      On some target deployment machines (using ODBC) I had to include the SQLDRIVERS folder in the deployed application root directory.

                      Hope that helps, goodluck!
                      [/quote]

                      Dpak Malla

                      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