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 database driver, IT difficulties
Forum Updated to NodeBB v4.3 + New Features

Building database driver, IT difficulties

Scheduled Pinned Locked Moved Solved General and Desktop
45 Posts 6 Posters 5.9k 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.
  • S Offline
    S Offline
    SPlatten
    wrote on 26 Apr 2021, 10:41 last edited by SPlatten
    #1

    I've build database drivers before for Qt, however these were on different systems. I'm presently working with a client supplied laptop. The laptop is a Windows 10 laptop with:

    Qt Creator 4.4.1
    Based on Qt 5.9.2 (MSVC 2015, 32 bit)
    

    The software I'm working on is using Qt 5.9.2 and Microsoft Visual Studio 2015, 32 bit.

    I know it's all very old and IMHO really should be brought up to date, however its not my decision, what makes things worse is that the IT department have locked down the laptop so there are various restrictions. I don't know why but I have been granted Admin permissions on the laptop but even this is limited in that I cannot modify system environment variables and neither can software I have installed.

    Its crazy, but I have to work with it. I'm need to build the MariaDB SQL driver for QT. I've been following:
    https://doc.qt.io/qt-5/sql-driver.html#driverwithqt

    Parts of this I can get working by putting the full path before the file name, however this fails with certain steps, presently I'm stuck with make install

    Where is make located?

    I've searched the Qt tree and can only find:

    C:\Qt\Qt5.9.2\5.9.2\Src\qtwebengine\src\3rdparty\chromium\third_party\libvpx\source\libvpx\build
    C:\Qt\Qt5.9.2\5.9.2\Src\qtwebengine\src\3rdparty\chromium\tools\gyp\text
    C:\Qt\Qt5.9.2\5.9.2\Src\qtwebengine\src\3rdparty\chromium\testing\gmock
    C:\Qt\Qt5.9.2\5.9.2\Src\qtwebengine\src\3rdparty\chromium\testing\gtest

    I can't find make in the Microsoft Visual Studio 14.0 installation tree.

    Kind Regards,
    Sy

    1 Reply Last reply
    0
    • S SPlatten
      26 Apr 2021, 11:18

      @J-Hilk , its like mission impossible, the laptop is so locked down its very difficult. I've cleaned out the cache:

      rm -R config.*
      

      Then run nmake. result is:

      Microsoft (R) Program Maintenance Utility Version 14.00.24245.0
      Copyright (C) Microsoft Corporation.  All rights reserved.
       
              cd sqlite\ && ( if not exist Makefile c:\Qt\Qt5.9.2\5.9.2\msvc2015\bin\qmake.exe -o Makefile C:\Qt\Qt5.9.2\5.9.2\Src\qtbase\src\plugins\sqldrivers\sqlite\sqlite.pro ) && "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\nmake.exe" -f Makefile
       
      Microsoft (R) Program Maintenance Utility Version 14.00.24245.0
      Copyright (C) Microsoft Corporation.  All rights reserved.
       
              "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\nmake.exe" -f Makefile.Release all
       
      Microsoft (R) Program Maintenance Utility Version 14.00.24245.0
      Copyright (C) Microsoft Corporation.  All rights reserved.
       
              rc /NOLOGO -DUNICODE -D_UNICODE -DWIN32 -DNDEBUG -DSQLITE_OMIT_LOAD_EXTENSION -DSQLITE_OMIT_COMPLETE -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_RTREE -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_NO_EXCEPTIONS -DQT_NO_DEBUG -DQT_PLUGIN -DQT_SQL_LIB -DQT_CORE_LIB -D_WINDLL -fo .obj\release\qsqlite_resource.res qsqlite_resource.rc
      qsqlite_resource.rc(1) : fatal error RC1015: cannot open include file 'windows.h'.
      NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\rc.EXE"' : return code '0x1'
      Stop.
      NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\nmake.exe"' : return code '0x2'
      Stop.
      NMAKE : fatal error U1077: 'cd' : return code '0x2'
      Stop.
      
      K Offline
      K Offline
      KroMignon
      wrote on 26 Apr 2021, 11:29 last edited by
      #11

      @SPlatten said in Building database driver, IT difficulties:

      its like mission impossible, the laptop is so locked down its very difficult. I've cleaned out the cache:

      It is not easy but follow this https://forum.qt.io/post/656068 and it should work

      It is an old maxim of mine that when you have excluded the impossible, whatever remains, however improbable, must be the truth. (Sherlock Holmes)

      S 1 Reply Last reply 26 Apr 2021, 11:57
      4
      • C Online
        C Online
        Christian Ehrlicher
        Lifetime Qt Champion
        wrote on 26 Apr 2021, 10:42 last edited by
        #2

        @SPlatten said in Building database driver, IT difficulties:

        Where is make located?

        According to the docs it's nmake

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

        S 1 Reply Last reply 26 Apr 2021, 10:45
        1
        • C Christian Ehrlicher
          26 Apr 2021, 10:42

          @SPlatten said in Building database driver, IT difficulties:

          Where is make located?

          According to the docs it's nmake

          S Offline
          S Offline
          SPlatten
          wrote on 26 Apr 2021, 10:45 last edited by SPlatten
          #3

          @Christian-Ehrlicher , thats not what that page I posted the link is asking for....

          cd $QTDIR/qtbase/src/plugins/sqldrivers/mysql
          make install
          

          Kind Regards,
          Sy

          J 1 Reply Last reply 26 Apr 2021, 10:56
          0
          • C Online
            C Online
            Christian Ehrlicher
            Lifetime Qt Champion
            wrote on 26 Apr 2021, 10:47 last edited by
            #4

            First you should tell us if you want to compile the whole Qt or only a single plugin

            But nonetheless it's nmake and not make when you use VisualStudio.

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

            S 1 Reply Last reply 26 Apr 2021, 10:49
            3
            • C Christian Ehrlicher
              26 Apr 2021, 10:47

              First you should tell us if you want to compile the whole Qt or only a single plugin

              But nonetheless it's nmake and not make when you use VisualStudio.

              S Offline
              S Offline
              SPlatten
              wrote on 26 Apr 2021, 10:49 last edited by
              #5

              @Christian-Ehrlicher , I thought I'd made it clear I am trying to build the SQL plugin driver for Qt. I am following the link:
              https://doc.qt.io/qt-5/sql-driver.html#driverwithqt

              What is vague about this? As previously stated the documentation calls:

              cd $QTDIR/qtbase/src/plugins/sqldrivers/mysql
              make install
              

              Kind Regards,
              Sy

              1 Reply Last reply
              0
              • C Online
                C Online
                Christian Ehrlicher
                Lifetime Qt Champion
                wrote on 26 Apr 2021, 10:51 last edited by Christian Ehrlicher
                #6

                So did you call qmake, were the mysql libs and include paths found and did you actually compile the driver like explained?

                Also why do you want to build the plugin for 5.9 on your own? It was still shipped there afair.

                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
                0
                • S SPlatten
                  26 Apr 2021, 10:45

                  @Christian-Ehrlicher , thats not what that page I posted the link is asking for....

                  cd $QTDIR/qtbase/src/plugins/sqldrivers/mysql
                  make install
                  
                  J Offline
                  J Offline
                  J.Hilk
                  Moderators
                  wrote on 26 Apr 2021, 10:56 last edited by J.Hilk
                  #7

                  @SPlatten I would actually suggest using jom instead of nmake, as nmake is single threaded

                  Stay with nmake for now ;-)


                  Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


                  Q: What's that?
                  A: It's blue light.
                  Q: What does it do?
                  A: It turns blue.

                  S 1 Reply Last reply 26 Apr 2021, 11:18
                  0
                  • J J.Hilk
                    26 Apr 2021, 10:56

                    @SPlatten I would actually suggest using jom instead of nmake, as nmake is single threaded

                    Stay with nmake for now ;-)

                    S Offline
                    S Offline
                    SPlatten
                    wrote on 26 Apr 2021, 11:18 last edited by
                    #8

                    @J-Hilk , its like mission impossible, the laptop is so locked down its very difficult. I've cleaned out the cache:

                    rm -R config.*
                    

                    Then run nmake. result is:

                    Microsoft (R) Program Maintenance Utility Version 14.00.24245.0
                    Copyright (C) Microsoft Corporation.  All rights reserved.
                     
                            cd sqlite\ && ( if not exist Makefile c:\Qt\Qt5.9.2\5.9.2\msvc2015\bin\qmake.exe -o Makefile C:\Qt\Qt5.9.2\5.9.2\Src\qtbase\src\plugins\sqldrivers\sqlite\sqlite.pro ) && "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\nmake.exe" -f Makefile
                     
                    Microsoft (R) Program Maintenance Utility Version 14.00.24245.0
                    Copyright (C) Microsoft Corporation.  All rights reserved.
                     
                            "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\nmake.exe" -f Makefile.Release all
                     
                    Microsoft (R) Program Maintenance Utility Version 14.00.24245.0
                    Copyright (C) Microsoft Corporation.  All rights reserved.
                     
                            rc /NOLOGO -DUNICODE -D_UNICODE -DWIN32 -DNDEBUG -DSQLITE_OMIT_LOAD_EXTENSION -DSQLITE_OMIT_COMPLETE -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_RTREE -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_NO_EXCEPTIONS -DQT_NO_DEBUG -DQT_PLUGIN -DQT_SQL_LIB -DQT_CORE_LIB -D_WINDLL -fo .obj\release\qsqlite_resource.res qsqlite_resource.rc
                    qsqlite_resource.rc(1) : fatal error RC1015: cannot open include file 'windows.h'.
                    NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\rc.EXE"' : return code '0x1'
                    Stop.
                    NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\nmake.exe"' : return code '0x2'
                    Stop.
                    NMAKE : fatal error U1077: 'cd' : return code '0x2'
                    Stop.
                    

                    Kind Regards,
                    Sy

                    K 1 Reply Last reply 26 Apr 2021, 11:29
                    0
                    • C Online
                      C Online
                      Christian Ehrlicher
                      Lifetime Qt Champion
                      wrote on 26 Apr 2021, 11:25 last edited by
                      #9

                      You're dev environment is not properly set up. You did not open it via 'Visual Studio command prompt' so the variables for your compiler are not there. Nothing Qt-related.

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

                      S 1 Reply Last reply 26 Apr 2021, 11:28
                      2
                      • C Christian Ehrlicher
                        26 Apr 2021, 11:25

                        You're dev environment is not properly set up. You did not open it via 'Visual Studio command prompt' so the variables for your compiler are not there. Nothing Qt-related.

                        S Offline
                        S Offline
                        SPlatten
                        wrote on 26 Apr 2021, 11:28 last edited by
                        #10

                        @Christian-Ehrlicher , where would I find that option? I've right clicked in the File Explorer and the only options appearing in the context menu are:

                        Open with Visual Studio
                        Git GUI Here
                        Git Bash Here
                        

                        Maybe something else the installer couldn't complete due to IT restrictions?

                        Kind Regards,
                        Sy

                        1 Reply Last reply
                        0
                        • S SPlatten
                          26 Apr 2021, 11:18

                          @J-Hilk , its like mission impossible, the laptop is so locked down its very difficult. I've cleaned out the cache:

                          rm -R config.*
                          

                          Then run nmake. result is:

                          Microsoft (R) Program Maintenance Utility Version 14.00.24245.0
                          Copyright (C) Microsoft Corporation.  All rights reserved.
                           
                                  cd sqlite\ && ( if not exist Makefile c:\Qt\Qt5.9.2\5.9.2\msvc2015\bin\qmake.exe -o Makefile C:\Qt\Qt5.9.2\5.9.2\Src\qtbase\src\plugins\sqldrivers\sqlite\sqlite.pro ) && "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\nmake.exe" -f Makefile
                           
                          Microsoft (R) Program Maintenance Utility Version 14.00.24245.0
                          Copyright (C) Microsoft Corporation.  All rights reserved.
                           
                                  "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\nmake.exe" -f Makefile.Release all
                           
                          Microsoft (R) Program Maintenance Utility Version 14.00.24245.0
                          Copyright (C) Microsoft Corporation.  All rights reserved.
                           
                                  rc /NOLOGO -DUNICODE -D_UNICODE -DWIN32 -DNDEBUG -DSQLITE_OMIT_LOAD_EXTENSION -DSQLITE_OMIT_COMPLETE -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_RTREE -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_NO_EXCEPTIONS -DQT_NO_DEBUG -DQT_PLUGIN -DQT_SQL_LIB -DQT_CORE_LIB -D_WINDLL -fo .obj\release\qsqlite_resource.res qsqlite_resource.rc
                          qsqlite_resource.rc(1) : fatal error RC1015: cannot open include file 'windows.h'.
                          NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\rc.EXE"' : return code '0x1'
                          Stop.
                          NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\nmake.exe"' : return code '0x2'
                          Stop.
                          NMAKE : fatal error U1077: 'cd' : return code '0x2'
                          Stop.
                          
                          K Offline
                          K Offline
                          KroMignon
                          wrote on 26 Apr 2021, 11:29 last edited by
                          #11

                          @SPlatten said in Building database driver, IT difficulties:

                          its like mission impossible, the laptop is so locked down its very difficult. I've cleaned out the cache:

                          It is not easy but follow this https://forum.qt.io/post/656068 and it should work

                          It is an old maxim of mine that when you have excluded the impossible, whatever remains, however improbable, must be the truth. (Sherlock Holmes)

                          S 1 Reply Last reply 26 Apr 2021, 11:57
                          4
                          • K KroMignon
                            26 Apr 2021, 11:29

                            @SPlatten said in Building database driver, IT difficulties:

                            its like mission impossible, the laptop is so locked down its very difficult. I've cleaned out the cache:

                            It is not easy but follow this https://forum.qt.io/post/656068 and it should work

                            S Offline
                            S Offline
                            SPlatten
                            wrote on 26 Apr 2021, 11:57 last edited by
                            #12

                            @KroMignon , excellent, thank you.

                            Kind Regards,
                            Sy

                            K 1 Reply Last reply 26 Apr 2021, 11:58
                            1
                            • S SPlatten
                              26 Apr 2021, 11:57

                              @KroMignon , excellent, thank you.

                              K Offline
                              K Offline
                              KroMignon
                              wrote on 26 Apr 2021, 11:58 last edited by
                              #13

                              @SPlatten said in Building database driver, IT difficulties:

                              excellent, thank you.

                              your welcome

                              It is an old maxim of mine that when you have excluded the impossible, whatever remains, however improbable, must be the truth. (Sherlock Holmes)

                              S 1 Reply Last reply 26 Apr 2021, 12:21
                              0
                              • K KroMignon
                                26 Apr 2021, 11:58

                                @SPlatten said in Building database driver, IT difficulties:

                                excellent, thank you.

                                your welcome

                                S Offline
                                S Offline
                                SPlatten
                                wrote on 26 Apr 2021, 12:21 last edited by
                                #14

                                @KroMignon , now it all appears to have built without any issues, I'm using source that I wrote on my iMAC when doing the same thing, have put in the database details using driver name QMYSQL, but when I try to connect I get the output:

                                QSqlDatabase: QMYSQL driver not loaded
                                QSqlDatabase: available drivers: QSQLITE QMYSQL QMYSQL3 QODBC QODBC3 QPSQL QPSQL7
                                

                                Kind Regards,
                                Sy

                                J K 2 Replies Last reply 26 Apr 2021, 12:28
                                0
                                • S SPlatten
                                  26 Apr 2021, 12:21

                                  @KroMignon , now it all appears to have built without any issues, I'm using source that I wrote on my iMAC when doing the same thing, have put in the database details using driver name QMYSQL, but when I try to connect I get the output:

                                  QSqlDatabase: QMYSQL driver not loaded
                                  QSqlDatabase: available drivers: QSQLITE QMYSQL QMYSQL3 QODBC QODBC3 QPSQL QPSQL7
                                  
                                  J Offline
                                  J Offline
                                  JonB
                                  wrote on 26 Apr 2021, 12:28 last edited by
                                  #15

                                  @SPlatten
                                  Whenever you get QMYSQL driver not loaded, start by setting environment variable QT_DEBUG_PLUGINS=1, run application, look at diagnostic output, especially at end.

                                  S 1 Reply Last reply 26 Apr 2021, 12:29
                                  1
                                  • J JonB
                                    26 Apr 2021, 12:28

                                    @SPlatten
                                    Whenever you get QMYSQL driver not loaded, start by setting environment variable QT_DEBUG_PLUGINS=1, run application, look at diagnostic output, especially at end.

                                    S Offline
                                    S Offline
                                    SPlatten
                                    wrote on 26 Apr 2021, 12:29 last edited by
                                    #16

                                    @JonB said in Building database driver, IT difficulties:

                                    QT_DEBUG_PLUGINS

                                    Thats easier said than done, on this system I cannot set environment variables....

                                    Kind Regards,
                                    Sy

                                    J K 2 Replies Last reply 26 Apr 2021, 12:33
                                    0
                                    • S SPlatten
                                      26 Apr 2021, 12:21

                                      @KroMignon , now it all appears to have built without any issues, I'm using source that I wrote on my iMAC when doing the same thing, have put in the database details using driver name QMYSQL, but when I try to connect I get the output:

                                      QSqlDatabase: QMYSQL driver not loaded
                                      QSqlDatabase: available drivers: QSQLITE QMYSQL QMYSQL3 QODBC QODBC3 QPSQL QPSQL7
                                      
                                      K Offline
                                      K Offline
                                      KroMignon
                                      wrote on 26 Apr 2021, 12:31 last edited by
                                      #17

                                      @SPlatten said in Building database driver, IT difficulties:

                                      QSqlDatabase: QMYSQL driver not loaded
                                      QSqlDatabase: available drivers: QSQLITE QMYSQL QMYSQL3 QODBC QODBC3 QPSQL QPSQL7

                                      I guess the mysql-connector dynamic library (libmysql.dll) is not in your path

                                      It is an old maxim of mine that when you have excluded the impossible, whatever remains, however improbable, must be the truth. (Sherlock Holmes)

                                      1 Reply Last reply
                                      0
                                      • S SPlatten
                                        26 Apr 2021, 12:29

                                        @JonB said in Building database driver, IT difficulties:

                                        QT_DEBUG_PLUGINS

                                        Thats easier said than done, on this system I cannot set environment variables....

                                        J Offline
                                        J Offline
                                        JonB
                                        wrote on 26 Apr 2021, 12:33 last edited by JonB
                                        #18

                                        @SPlatten said in Building database driver, IT difficulties:

                                        Thats easier said than done, on this system I cannot set environment variables....

                                        That is an unusual statement, I have not heard of such a system. You will have problems if you cannot set environment variables....

                                        You should be able to do so. Even if you have to write a one-line "wrapper" program....

                                        S 1 Reply Last reply 26 Apr 2021, 12:36
                                        0
                                        • S SPlatten
                                          26 Apr 2021, 12:29

                                          @JonB said in Building database driver, IT difficulties:

                                          QT_DEBUG_PLUGINS

                                          Thats easier said than done, on this system I cannot set environment variables....

                                          K Offline
                                          K Offline
                                          KroMignon
                                          wrote on 26 Apr 2021, 12:35 last edited by
                                          #19

                                          @SPlatten said in Building database driver, IT difficulties:

                                          Thats easier said than done, on this system I cannot set environment variables....

                                          You can do it with Qt-Creator: Projects / Build & Run, Select "Run", than in "Run Settings"/Environment you can add as many environment variable as you want => cf. https://doc.qt.io/qtcreator/creator-project-settings-environment.html

                                          It is an old maxim of mine that when you have excluded the impossible, whatever remains, however improbable, must be the truth. (Sherlock Holmes)

                                          1 Reply Last reply
                                          0
                                          • J JonB
                                            26 Apr 2021, 12:33

                                            @SPlatten said in Building database driver, IT difficulties:

                                            Thats easier said than done, on this system I cannot set environment variables....

                                            That is an unusual statement, I have not heard of such a system. You will have problems if you cannot set environment variables....

                                            You should be able to do so. Even if you have to write a one-line "wrapper" program....

                                            S Offline
                                            S Offline
                                            SPlatten
                                            wrote on 26 Apr 2021, 12:36 last edited by
                                            #20

                                            @JonB , tell me about it, please read the first post on this thread for more information.

                                            Kind Regards,
                                            Sy

                                            J 1 Reply Last reply 26 Apr 2021, 12:51
                                            0

                                            10/45

                                            26 Apr 2021, 11:28

                                            topic:navigator.unread, 35
                                            • Login

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