Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Building plugins with MSVC [mysql-driver]
Forum Updated to NodeBB v4.3 + New Features

Building plugins with MSVC [mysql-driver]

Scheduled Pinned Locked Moved Solved General and Desktop
6 Posts 3 Posters 857 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.
  • U Offline
    U Offline
    unzu
    wrote on 23 Dec 2020, 21:31 last edited by
    #1

    Hi,

    I am having trouble building the mysql-driver-plugin on my windows desktop.
    I know there are already like a hundred threads here and probably thousands more in other forums concering this topic and I've probably worked through the majority of them, but i cannot get it to work.
    I have successfully build the driver on my linux system, however I cannot replicate that on my windows machine.

    My Setup:

    1. I have downloaded Microsoft Visual Studio 2019 (not sure if that was necessary)
    2. I have downloaded both the binaries and the source code of version 5.15.2 via the online installer

    From my understanding I need to use the Qt-Console, switch to the folder .../qtbase/src/plugins/sqldrivers/ and run qmake and pass the paths to the include and lib-folder of the mysql-library which I have downloaded myself.
    But when I run qmake in the Qt-Console there is not output, no hints, no error-messages..
    I feel like there was some output in linux which said which drivers were enabled for build - here is see nothing.

    I am kind of stuck and don't know what else I could try.

    Thanks in advance for your time and hints,
    Unzu

    1 Reply Last reply
    0
    • C Offline
      C Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on 23 Dec 2020, 21:35 last edited by
      #2

      @unzu said in Building plugins with MSVC [mysql-driver]:

      But when I run qmake in the Qt-Console there is not output, no hints, no error-messages..

      Please read the doc, correctly call qmake and show us the output.
      Or better: drop MySQLand use PostgreSQL - this plugin is provided by the Qt installer.

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      1 Reply Last reply
      1
      • U Offline
        U Offline
        unzu
        wrote on 23 Dec 2020, 21:57 last edited by
        #3

        Ok, thats what I get:

        C:\Qt\5.15.2\Src\qtbase\src\plugins\sqldrivers>qmake -version
        QMake version 3.1
        Using Qt version 5.15.2 in C:/Qt/5.15.2/msvc2019_64/lib
        
        C:\Qt\5.15.2\Src\qtbase\src\plugins\sqldrivers>qmake -- MYSQL_INCDIR="C:/MYSQL/include" MYSQL_LIBDIR="C:/MYSQL/lib"
        Project ERROR: You cannot configure sqldrivers separately within a top-level build.
        

        So at least I am getting some feedback now.
        Right now I am trying to figure out what it means with the top-level-build-thingy.

        Unzu

        E C 2 Replies Last reply 23 Dec 2020, 22:05
        0
        • U unzu
          23 Dec 2020, 21:57

          Ok, thats what I get:

          C:\Qt\5.15.2\Src\qtbase\src\plugins\sqldrivers>qmake -version
          QMake version 3.1
          Using Qt version 5.15.2 in C:/Qt/5.15.2/msvc2019_64/lib
          
          C:\Qt\5.15.2\Src\qtbase\src\plugins\sqldrivers>qmake -- MYSQL_INCDIR="C:/MYSQL/include" MYSQL_LIBDIR="C:/MYSQL/lib"
          Project ERROR: You cannot configure sqldrivers separately within a top-level build.
          

          So at least I am getting some feedback now.
          Right now I am trying to figure out what it means with the top-level-build-thingy.

          Unzu

          E Offline
          E Offline
          eyllanesc
          wrote on 23 Dec 2020, 22:05 last edited by eyllanesc
          #4

          @unzu You have to use mysql connector https://downloads.mysql.com/archives/get/p/19/file/mysql-connector-c-6.1.11-winx64.zip then:

          call "C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Auxiliary/Build/vcvars64.bat"
          cd qtbase/src/plugins/sqldrivers
          qmake -- MYSQL_INCDIR="\path\of\mysql-connector-c-6.1.11-winx64\include" MYSQL_LIBDIR="\path\of\mysql-connector-c-6.1.11-winx64\lib"
          nmake sub-mysql
          nmake install
          

          I have a Github Actions that produces the plugin: https://github.com/eyllanesc/stackoverflow/blob/master/.github/workflows/mysql_plugin.yml#L36

          If you want me to help you develop some work then you can write to my email: e.yllanescucho@gmal.com.

          1 Reply Last reply
          3
          • U unzu
            23 Dec 2020, 21:57

            Ok, thats what I get:

            C:\Qt\5.15.2\Src\qtbase\src\plugins\sqldrivers>qmake -version
            QMake version 3.1
            Using Qt version 5.15.2 in C:/Qt/5.15.2/msvc2019_64/lib
            
            C:\Qt\5.15.2\Src\qtbase\src\plugins\sqldrivers>qmake -- MYSQL_INCDIR="C:/MYSQL/include" MYSQL_LIBDIR="C:/MYSQL/lib"
            Project ERROR: You cannot configure sqldrivers separately within a top-level build.
            

            So at least I am getting some feedback now.
            Right now I am trying to figure out what it means with the top-level-build-thingy.

            Unzu

            C Offline
            C Offline
            Christian Ehrlicher
            Lifetime Qt Champion
            wrote on 24 Dec 2020, 08:50 last edited by
            #5

            @unzu said in Building plugins with MSVC [mysql-driver]:

            Project ERROR: You cannot configure sqldrivers separately within a top-level build.

            This looks like you run configure.bat already in the base source dir. Start over with a clean source dir.

            Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
            Visit the Qt Academy at https://academy.qt.io/catalog

            1 Reply Last reply
            1
            • U Offline
              U Offline
              unzu
              wrote on 24 Dec 2020, 08:59 last edited by
              #6

              @Christian-Ehrlicher said in Building plugins with MSVC [mysql-driver]:

              This looks like you run configure.bat already in the base source dir. Start over with a clean source dir.

              Yes, I just did that.
              That was the issue - I ran the configure script in the base source directory prior to this.
              After re-downloading the entire sources I was able to build the driver.

              Thanks!

              1 Reply Last reply
              1

              1/6

              23 Dec 2020, 21:31

              • 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