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
QtWS25 Last Chance

Building database driver, IT difficulties

Scheduled Pinned Locked Moved Solved General and Desktop
45 Posts 6 Posters 5.8k 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.
  • J.HilkJ J.Hilk

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

    Stay with nmake for now ;-)

    SPlattenS Offline
    SPlattenS Offline
    SPlatten
    wrote on 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

    KroMignonK 1 Reply Last reply
    0
    • Christian EhrlicherC Online
      Christian EhrlicherC Online
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on 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

      SPlattenS 1 Reply Last reply
      2
      • Christian EhrlicherC Christian Ehrlicher

        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.

        SPlattenS Offline
        SPlattenS Offline
        SPlatten
        wrote on 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
        • SPlattenS SPlatten

          @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.
          
          KroMignonK Offline
          KroMignonK Offline
          KroMignon
          wrote on 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)

          SPlattenS 1 Reply Last reply
          4
          • KroMignonK KroMignon

            @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

            SPlattenS Offline
            SPlattenS Offline
            SPlatten
            wrote on last edited by
            #12

            @KroMignon , excellent, thank you.

            Kind Regards,
            Sy

            KroMignonK 1 Reply Last reply
            1
            • SPlattenS SPlatten

              @KroMignon , excellent, thank you.

              KroMignonK Offline
              KroMignonK Offline
              KroMignon
              wrote on 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)

              SPlattenS 1 Reply Last reply
              0
              • KroMignonK KroMignon

                @SPlatten said in Building database driver, IT difficulties:

                excellent, thank you.

                your welcome

                SPlattenS Offline
                SPlattenS Offline
                SPlatten
                wrote on 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

                JonBJ KroMignonK 2 Replies Last reply
                0
                • SPlattenS SPlatten

                  @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
                  
                  JonBJ Online
                  JonBJ Online
                  JonB
                  wrote on 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.

                  SPlattenS 1 Reply Last reply
                  1
                  • JonBJ JonB

                    @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.

                    SPlattenS Offline
                    SPlattenS Offline
                    SPlatten
                    wrote on 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

                    JonBJ KroMignonK 2 Replies Last reply
                    0
                    • SPlattenS SPlatten

                      @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
                      
                      KroMignonK Offline
                      KroMignonK Offline
                      KroMignon
                      wrote on 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
                      • SPlattenS SPlatten

                        @JonB said in Building database driver, IT difficulties:

                        QT_DEBUG_PLUGINS

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

                        JonBJ Online
                        JonBJ Online
                        JonB
                        wrote on 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....

                        SPlattenS 1 Reply Last reply
                        0
                        • SPlattenS SPlatten

                          @JonB said in Building database driver, IT difficulties:

                          QT_DEBUG_PLUGINS

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

                          KroMignonK Offline
                          KroMignonK Offline
                          KroMignon
                          wrote on 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
                          • JonBJ JonB

                            @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....

                            SPlattenS Offline
                            SPlattenS Offline
                            SPlatten
                            wrote on last edited by
                            #20

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

                            Kind Regards,
                            Sy

                            JonBJ 1 Reply Last reply
                            0
                            • SPlattenS SPlatten

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

                              JonBJ Online
                              JonBJ Online
                              JonB
                              wrote on last edited by JonB
                              #21

                              @SPlatten
                              If you mean

                              I cannot modify system environment variables

                              there is no need to set a system variable, only an environment variable for the duration of running your program. Either in a Command Prompt, or as @KroMignon wrote in Qt Creator if you are running from there. Or in a .bat script, or in a one-line "wrapper" C/C++ program. heck, you're running nmake, that I believe sets environment variables, you could even do so from there....

                              And, depending on when Qt produces that runtime error, if it's on the statement which creates a QSqlDatabase, as I think it might be, then you can just set the environment variable in the Qt program you are writing beforehand.

                              SPlattenS 1 Reply Last reply
                              0
                              • JonBJ JonB

                                @SPlatten
                                If you mean

                                I cannot modify system environment variables

                                there is no need to set a system variable, only an environment variable for the duration of running your program. Either in a Command Prompt, or as @KroMignon wrote in Qt Creator if you are running from there. Or in a .bat script, or in a one-line "wrapper" C/C++ program. heck, you're running nmake, that I believe sets environment variables, you could even do so from there....

                                And, depending on when Qt produces that runtime error, if it's on the statement which creates a QSqlDatabase, as I think it might be, then you can just set the environment variable in the Qt program you are writing beforehand.

                                SPlattenS Offline
                                SPlattenS Offline
                                SPlatten
                                wrote on last edited by
                                #22

                                @JonB , setting an environment variable doesn't help when Qt Creator is running at the system level. Any environment variable added to the console, is only visible to the environment of the console.

                                Kind Regards,
                                Sy

                                JonBJ KroMignonK 2 Replies Last reply
                                0
                                • SPlattenS SPlatten

                                  @JonB , setting an environment variable doesn't help when Qt Creator is running at the system level. Any environment variable added to the console, is only visible to the environment of the console.

                                  JonBJ Online
                                  JonBJ Online
                                  JonB
                                  wrote on last edited by JonB
                                  #23

                                  @SPlatten
                                  I have tried to show you a number of places you can set the environment variable. If you really say you cannot from Qt Creator (I don't understand why not and I don't understand what you are saying), try any of the others....

                                  1 Reply Last reply
                                  0
                                  • SPlattenS SPlatten

                                    @JonB , setting an environment variable doesn't help when Qt Creator is running at the system level. Any environment variable added to the console, is only visible to the environment of the console.

                                    KroMignonK Offline
                                    KroMignonK Offline
                                    KroMignon
                                    wrote on last edited by
                                    #24

                                    @SPlatten said in Building database driver, IT difficulties:

                                    setting an environment variable doesn't help when Qt Creator is running at the system level. Any environment variable added to the console, is only visible to the environment of the console.

                                    Have you only try it out?
                                    Based on your first post on this thread, you are using Qt Creator 4.4.1.
                                    Settings environment variables with QtCreator works for me, on any system I am using (WindowsXP/7/10 and Linux).
                                    So I cannot imagine it will not work for you.

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

                                    SPlattenS 1 Reply Last reply
                                    0
                                    • KroMignonK KroMignon

                                      @SPlatten said in Building database driver, IT difficulties:

                                      setting an environment variable doesn't help when Qt Creator is running at the system level. Any environment variable added to the console, is only visible to the environment of the console.

                                      Have you only try it out?
                                      Based on your first post on this thread, you are using Qt Creator 4.4.1.
                                      Settings environment variables with QtCreator works for me, on any system I am using (WindowsXP/7/10 and Linux).
                                      So I cannot imagine it will not work for you.

                                      SPlattenS Offline
                                      SPlattenS Offline
                                      SPlatten
                                      wrote on last edited by
                                      #25

                                      @KroMignon , just created the variable and verified that it is there using EXPORT, rebuilt project in Qt Creator and executed, no new / additional output in Application Output and the console just contains:

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

                                      Kind Regards,
                                      Sy

                                      JonBJ KroMignonK 2 Replies Last reply
                                      0
                                      • SPlattenS SPlatten

                                        @KroMignon , just created the variable and verified that it is there using EXPORT, rebuilt project in Qt Creator and executed, no new / additional output in Application Output and the console just contains:

                                        QSqlDatabase: QMYSQL driver not loaded
                                        QSqlDatabase: available drivers: QSQLITE QMYSQL QMYSQL3 QODBC QODBC3 QPSQL QPSQL7
                                        
                                        JonBJ Online
                                        JonBJ Online
                                        JonB
                                        wrote on last edited by
                                        #26

                                        @SPlatten
                                        What is the name of the environment variable, and what is its value?

                                        1 Reply Last reply
                                        0
                                        • SPlattenS SPlatten

                                          @KroMignon , just created the variable and verified that it is there using EXPORT, rebuilt project in Qt Creator and executed, no new / additional output in Application Output and the console just contains:

                                          QSqlDatabase: QMYSQL driver not loaded
                                          QSqlDatabase: available drivers: QSQLITE QMYSQL QMYSQL3 QODBC QODBC3 QPSQL QPSQL7
                                          
                                          KroMignonK Offline
                                          KroMignonK Offline
                                          KroMignon
                                          wrote on last edited by KroMignon
                                          #27

                                          @SPlatten said in Building database driver, IT difficulties:

                                          just created the variable and verified that it is there using EXPORT, rebuilt project in Qt Creator and executed, no new / additional output in Application Output and the console just contains:

                                          You don't have to recompile your application, just setup the environment variable for you project
                                          e1d94075-09a2-4dcb-bfd2-9c78babf80fe-image.png

                                          And the run the application with F5 or Ctrl+R, that's it.

                                          But as I have written before, I am quiet sure your problem is that the mysql-connector dynamic library is not in your path.
                                          The easiest way to solve this is to copy libmysql.dll in to Qt lib path, which should be for Qt 5.9.2 ==> C:\Qt\5.9.2\msvc2015\bin\

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

                                          SPlattenS 1 Reply Last reply
                                          2

                                          • Login

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