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. Struggling with MySQL driver build
QtWS25 Last Chance

Struggling with MySQL driver build

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
mysql drivermingw32-makemysql
4 Posts 2 Posters 821 Views
  • 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
    TTherrien
    wrote on 15 Jan 2020, 20:58 last edited by
    #1

    I have a 32-bit MSVC application that I would like to use MySQL drive with. I've read through the documentation and at least 20+ forum post regarding this. I am a noob and apologize for my arrogance.

    Currently I have MySQL server and connector libs/include in a folder C:\mysql drive without spaces as recommended. I am using MinGW 64-bit (not sure which version I need).

    I ran:

    1. set mysql=C:\mysqltemp
    2. cd F:\Qt\5.14.0\Src\qtbase\src\plugins\sqldrivers\mysql
    3. qmake "INCLUDEPATH+=C:\MySQL\include" "LIBS+=-LC:\MYSQL\lib\libmysql.lib -lmysql"
    4. ming32-make

    Now I receive an error "x86_64-w64-mingw32/bin/ld.exe: cannot find -lmysql"

    I assume this has something to do with reimp mentioned here:
    https://doc.qt.io/archives/qt-4.8/sql-driver.html#qmysql-for-mysql-4-and-higher

    Before I go down another rabbit hole since I know nothing about reimp, is this a correct assumtion?

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 15 Jan 2020, 21:57 last edited by
      #2

      Hi and welcome to devnet,

      First issue, you are mentioning 32MSVC then go on with MinGW 64, so which one is it ?

      Second, what you should get is the MySQL C connector library not the C++.

      Third, unless you are indeed using Qt 4, the command is wrong, please read the Qt 5 instructions matching the Qt version you are currently using.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      2
      • T Offline
        T Offline
        TTherrien
        wrote on 16 Jan 2020, 17:55 last edited by
        #3

        I am not sure can you help me figure out what I need? I have a 32MSVC program but need to build the MySQL driver. In order to do that do I use MinGW 64 to compile? I was not able to find any instructions on how to build for/with MSVC.

        Secondly, wow I did not realize I was using the wrong library palm face.

        Third, I have read Qt 5 instructions and did originally try it with that, but after reading forum posts I switched back.

        I will install the C connector, clean up my build directory, and attempt with Qt 5 instructions. However where would I build this, using MinGW 32 CMD? Because once it is build I just need to bring two DLLs over to my application build directory correct?

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 16 Jan 2020, 20:36 last edited by
          #4

          No, you have to use the same compiler that was used to build Qt. You can't mix and match C++ librairies built with MinGW and MSVC.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          1

          4/4

          16 Jan 2020, 20:36

          • Login

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