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. QT Open Source and Databases
Forum Updated to NodeBB v4.3 + New Features

QT Open Source and Databases

Scheduled Pinned Locked Moved Unsolved General and Desktop
8 Posts 3 Posters 758 Views 2 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.
  • E Offline
    E Offline
    Eric_Lund
    wrote on last edited by
    #1

    Does QT limit what databases can be used with the open source version of QT. On my computer, I have MySQL, PostgreSQL, SQL Server, and ... cough, cough, ... MS Access. So far, I've been unable to build a driver for MySQL and PostgreSQL. For PostgreSQL everything I try gets me the error

    Cannot read C:/qtsqldrivers-config.pri: No such file or directory
    Cannot read /mkspecs/modules-inst/qt_plugin_qsqlpsql.pri: No such file or directory

    I got that when I tried qmake on the psql.pro file.

    So far, it seems like the only database I can connect an application to is SQLITE, which as I understand, is not really a database.

    JKSHJ 1 Reply Last reply
    0
    • E Eric_Lund

      Does QT limit what databases can be used with the open source version of QT. On my computer, I have MySQL, PostgreSQL, SQL Server, and ... cough, cough, ... MS Access. So far, I've been unable to build a driver for MySQL and PostgreSQL. For PostgreSQL everything I try gets me the error

      Cannot read C:/qtsqldrivers-config.pri: No such file or directory
      Cannot read /mkspecs/modules-inst/qt_plugin_qsqlpsql.pri: No such file or directory

      I got that when I tried qmake on the psql.pro file.

      So far, it seems like the only database I can connect an application to is SQLITE, which as I understand, is not really a database.

      JKSHJ Offline
      JKSHJ Offline
      JKSH
      Moderators
      wrote on last edited by JKSH
      #2

      @Eric_Lund said in QT Open Source and Databases:

      Does QT limit what databases can be used with the open source version of QT.

      Qt does not impose a limit. However, the database drivers have different licenses compared to open-source Qt's (L)GPL, which is why the Qt Project doesn't ship them by default and users have the build the drivers themselves.

      So far, I've been unable to build a driver for MySQL and PostgreSQL. For PostgreSQL everything I try gets me the error

      Cannot read C:/qtsqldrivers-config.pri: No such file or directory
      Cannot read /mkspecs/modules-inst/qt_plugin_qsqlpsql.pri: No such file or directory

      I got that when I tried qmake on the psql.pro file.

      Please describe in more detail:

      1. How and where you installed the PostgreSQL headers and libraries
      2. How you got the Qt source code
      3. How you ran qmake

      There are some instructions at https://doc.qt.io/qt-5/sql-driver.html#how-to-build-the-qpsql-plugin-on-windows

      So far, it seems like the only database I can connect an application to is SQLITE, which as I understand, is not really a database.

      SQLite is not a client-server database, but it's certainly an ACID-compliant database.

      Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

      1 Reply Last reply
      1
      • E Offline
        E Offline
        Eric_Lund
        wrote on last edited by
        #3

        Please describe in more detail:

        How and where you installed the PostgreSQL headers and libraries
        Windows installer on x64 (I'm on build 10.0.19041.0)
        C:\tools\PostgreSQL\13 include and lib dirs

        How you got the Qt source code
        Full install from the QT website to: C:\tools\Qt\5.15.1\Src ... thence ... qtbase\src\plugins\sqldrivers

        I'm using C:\Program Files (x86)\Microsoft Visual Studio\2019\Community \VC\Tools\MSVC\14.27.29110\bin\Hostx64\x64 as my compiler platform.

        How you ran qmake
        I got tired of errors at the command line, so I loaded the project to QtCreator, and ran qmake. That generated the error I posted.

        I was able to get a Makefile on the command line, but I was having a lot of difficulty getting all the paths correct so nmake could build.

        I suspect that I need a few more items in environment variables before everything will build. I'm probably just getting frustrated. Started down this path because I got thrown into a project at work where we are converting our AIX (a UNIX) applications to Linux, and using QT for the UIs (Previously done in BxPro (Ick). I figure the more I used this at home, the less I'll struggle with it at work. Never had this much trouble configuring a database before to work with an application.

        1 Reply Last reply
        0
        • Christian EhrlicherC Offline
          Christian EhrlicherC Offline
          Christian Ehrlicher
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @Eric_Lund said in QT Open Source and Databases:

          How you ran qmake

          Please follow the instructions in the link @JKSH gave you. It will not work from QtCreator.

          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
          • E Offline
            E Offline
            Eric_Lund
            wrote on last edited by
            #5

            OK, started doing the stuff on that link, and got this error:

            PS C:\tools\Qt\5.15.1\Src\qtbase\src\plugins\sqldrivers> qmake -- PSQL_INCDIR=C:\tools\PostgreSQL\13\include PSQL_LIBDIR=C:\tools\PostgreSQL\13\lib
            qmake : Project ERROR: You cannot configure sqldrivers separately within a top-level build.
            At line:1 char:1
            + qmake -- PSQL_INCDIR=C:\tools\PostgreSQL\13\include PSQL_LIBDIR=C:\to ...
            + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                + CategoryInfo          : NotSpecified: (Project ERROR: ...op-level build.:String) [], RemoteException
                + FullyQualifiedErrorId : NativeCommandError
             
            

            Working on figuring out what that means...

            Thanks,
            Eric

            1 Reply Last reply
            0
            • Christian EhrlicherC Offline
              Christian EhrlicherC Offline
              Christian Ehrlicher
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @Eric_Lund said in QT Open Source and Databases:

              Working on figuring out what that means...

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

              Isn't this clear? You did not use an empty qt source tree.

              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
              • E Offline
                E Offline
                Eric_Lund
                wrote on last edited by
                #7

                That's what I figured. I also saw something that says I need perl, and possibly python to initialize a newly downloaded source code. Got Perl installed. The various chores happened, and now I'm going to download and install python. Then I'll download the source for QT. Good thing I recently replaced my nearly full 500GB ssd drive with a 2TB model. Lots of room.

                As a windows user (ie, not developer), I never really understood the complaints. What a pita. The cntl-C --> cntl V repetition is nuts. I seem to remember Bill Gates saying that was one of the things he truly regretted. That and having to completely learn a different command line. At least power shell recognizes ls. 😁

                find . -name windows.h becomes
                Get-ChildItem -Path C:\ -Include windows.h -Recurse -ErrorAction SilentlyContinue
                It's insane!

                1 Reply Last reply
                1
                • Christian EhrlicherC Offline
                  Christian EhrlicherC Offline
                  Christian Ehrlicher
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  You neither need perl nor python to compile the sql plugins. Please follow the docs!

                  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

                  • Login

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