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. Can't load sql drivers when configuring and building Qt 6.8.1 from source on linux/Ubuntu 24.04.1

Can't load sql drivers when configuring and building Qt 6.8.1 from source on linux/Ubuntu 24.04.1

Scheduled Pinned Locked Moved Solved Installation and Deployment
15 Posts 5 Posters 1.2k 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.
  • S Offline
    S Offline
    SGaist
    Lifetime Qt Champion
    wrote on 12 Dec 2024, 18:58 last edited by
    #6

    Hi,

    PATH has nothing to do with library discovery. You're working on Linux, not Windows.
    Use the -L argument to add additional paths to configure.

    On a side note, stop working as root. There's no need for that for any build activity.

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

    K 3 Replies Last reply 12 Dec 2024, 20:47
    1
    • S SGaist
      12 Dec 2024, 18:58

      Hi,

      PATH has nothing to do with library discovery. You're working on Linux, not Windows.
      Use the -L argument to add additional paths to configure.

      On a side note, stop working as root. There's no need for that for any build activity.

      K Offline
      K Offline
      KingWm
      wrote on 12 Dec 2024, 20:47 last edited by
      #7
      This post is deleted!
      1 Reply Last reply
      0
      • S SGaist
        12 Dec 2024, 18:58

        Hi,

        PATH has nothing to do with library discovery. You're working on Linux, not Windows.
        Use the -L argument to add additional paths to configure.

        On a side note, stop working as root. There's no need for that for any build activity.

        K Offline
        K Offline
        KingWm
        wrote on 13 Dec 2024, 01:47 last edited by KingWm
        #8

        @SGaist I set the path variable because it is mentioned several times in the various docs I have read. I don't know if it is useful in this scenario or not.

        I used -L arguments to pass the include and lib directories.

        /usr/local/postgresql/17.2/include
        /usr/local/postgresql/17.2/lib
        

        In a new error message, it complained it couldn't find Ninja, so I added my Ninja path.

        /usr/local/ninja/1.12.1
        

        I am using sudo because nothing will work unless I use it. I presume it is because the source, build and install directories are all in /usr/local/.

        I ran the following command, it fails with the same Postgres not found error.

        ../qt/configure -init-submodules -prefix /usr/local/qt/6.8.1 -sql-psql -L /usr/local/postgresql/17.2/lib -I /usr/local/postgresql/17.2/include -- -DCMAKE_BUILD_TYPE=Release -DCMAKE_GENERATOR=Ninja /usr/local/ninja/1.12.1
        

        But when I run it WITHOUT the -sql-psql option, configure completes successfully with a few warnings. One is that it ignored the the path i provided for Ninja. Again, Ninja is on the path, but if it ignores that path I provide, I don't know how it is finding Ninja unless a sub-routine is providing it.

        + /usr/local/src/qt/qtbase/configure -top-level -prefix /usr/local/qt/6.8.1 -L /usr/local/postgresql/17.2/lib -I /usr/local/postgresql/17.2/include -- -DCMAKE_BUILD_TYPE=Release -DCMAKE_GENERATOR=Ninja /usr/local/ninja/1.12.1
        '/usr/bin/cmake' '-DCMAKE_BUILD_TYPE=Release' '-DCMAKE_GENERATOR=Ninja' '/usr/local/ninja/1.12.1' '-DQT_INTERNAL_CALLED_FROM_CONFIGURE:BOOL=TRUE' '-DCMAKE_INSTALL_PREFIX=/usr/local/qt/6.8.1' '-DQT_EXTRA_INCLUDEPATHS=/usr/local/postgresql/17.2/include' '-DQT_EXTRA_LIBDIRS=/usr/local/postgresql/17.2/lib' '-G' 'Ninja' '/usr/local/src/qt'
        CMake Warning:
          Ignoring extra path from command line:
        
           "/usr/local/ninja/1.12.1"
        
        -- The CXX compiler identification is GNU 13.3.0
        -- The C compiler identification is GNU 13.3.0
        
        1 Reply Last reply
        0
        • C Online
          C Online
          Christian Ehrlicher
          Lifetime Qt Champion
          wrote on 13 Dec 2024, 05:20 last edited by
          #9

          Pass PostgreSQL_ROOT as written in the documentation: https://doc.qt.io/qt-6/sql-driver.html#how-to-build-the-qpsql-plugin-on-unix-and-macos

          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 13 Dec 2024, 05:52
          2
          • C Christian Ehrlicher
            13 Dec 2024, 05:20

            Pass PostgreSQL_ROOT as written in the documentation: https://doc.qt.io/qt-6/sql-driver.html#how-to-build-the-qpsql-plugin-on-unix-and-macos

            S Offline
            S Offline
            SGaist
            Lifetime Qt Champion
            wrote on 13 Dec 2024, 05:52 last edited by
            #10

            @Christian-Ehrlicher said in Can't load sql drivers when configuring and building Qt 6.8.1 from source on linux/Ubuntu 24.04.1:

            Pass PostgreSQL_ROOT as written in the documentation: https://doc.qt.io/qt-6/sql-driver.html#how-to-build-the-qpsql-plugin-on-unix-and-macos

            My bad for the -L pointer ! Old Qt 5 habits.

            @Christian-Ehrlicher is correct.

            As for the sudo requirements, it's still wrong. The fact that you have stuff in /usr/local should have no influence unless there's a in issue with the files permissions that should be fixed.

            As for PATH, it's only used to find executables on Linux, it has nothing to do with libraries.

            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
            • K KingWm has marked this topic as solved on 28 Dec 2024, 04:59
            • J jsulm
              12 Dec 2024, 06:22

              @KingWm If you want to build a SQL driver you have to install needed dependencies. For PostgreSQL you have to install libpq5 library and libpq-dev packages.

              K Offline
              K Offline
              KingWm
              wrote on 28 Dec 2024, 05:06 last edited by KingWm
              #11

              @jsulm I added libpq5 and libpq-dev packages with dependencies and my configuration completed successfully. Unfortunately, after waiting patiently for the build to complete, the install failed on the "last line", something about a missing a file. It caused me to reconsider my efforts. I am pretty sure this solved the original problem I posted about, sorry I didn't save the output.

              I did check the docs and I didn'ts see those dependencies mentioned anywhere. I feel like the official docs should have those dependencies listed. Thank you.

              1 Reply Last reply
              0
              • C Christian Ehrlicher
                12 Dec 2024, 17:25

                Why did you compile postgresql by yourself? Simply use the ones from your distro...
                Where did you install postgresql to? If it's a non-default location you have to pass this to configure in a clean build dir.

                K Offline
                K Offline
                KingWm
                wrote on 28 Dec 2024, 05:18 last edited by
                #12

                @Christian-Ehrlicher I was building it for the wrong reasons, I discovered. At the end of the day, I successfully built 3 packages and believe I would have eventually gotten PG done as well. I learned what I set out to learn and so I abandoned this project.

                As it turned out, I had mis-configured my disks and my small OS drive filled up quickly. I had to start over with a fresh install and the decision to do things conventionally was easy. Thank you.

                1 Reply Last reply
                0
                • S SGaist
                  12 Dec 2024, 18:58

                  Hi,

                  PATH has nothing to do with library discovery. You're working on Linux, not Windows.
                  Use the -L argument to add additional paths to configure.

                  On a side note, stop working as root. There's no need for that for any build activity.

                  K Offline
                  K Offline
                  KingWm
                  wrote on 28 Dec 2024, 05:28 last edited by
                  #13

                  @SGaist said in Can't load sql drivers when configuring and building Qt 6.8.1 from source on linux/Ubuntu 24.04.1:

                  On a side note, stop working as root. There's no need for that for any build activity.

                  I have noticed a pattern and clearly I need to change a bad habit. Thank you.

                  1 Reply Last reply
                  0
                  • Y Offline
                    Y Offline
                    Yihua Liu
                    wrote on 25 Feb 2025, 01:26 last edited by
                    #14

                    Then what is the case for oracle qoci? I run

                    ./configure -prefix /opt/qt-static -static -release -opensource -confirm-license -nomake examples -nomake tests -sql-oci -DOracle_ROOT=/home/yihua/app/yihua/product/21.0.0/client_1

                    but it still shows Resetting 'FEATURE_sql_oci' from 'ON' to 'OFF' because it doesn't meet its condition after reconfiguration. Condition expression is: 'Oracle_FOUND'. I confirmed that libclntsh.so exists under the client_1 directory

                    C 1 Reply Last reply 25 Feb 2025, 05:14
                    0
                    • Y Yihua Liu
                      25 Feb 2025, 01:26

                      Then what is the case for oracle qoci? I run

                      ./configure -prefix /opt/qt-static -static -release -opensource -confirm-license -nomake examples -nomake tests -sql-oci -DOracle_ROOT=/home/yihua/app/yihua/product/21.0.0/client_1

                      but it still shows Resetting 'FEATURE_sql_oci' from 'ON' to 'OFF' because it doesn't meet its condition after reconfiguration. Condition expression is: 'Oracle_FOUND'. I confirmed that libclntsh.so exists under the client_1 directory

                      C Online
                      C Online
                      Christian Ehrlicher
                      Lifetime Qt Champion
                      wrote on 25 Feb 2025, 05:14 last edited by Christian Ehrlicher
                      #15

                      @Yihua-Liu said in Can't load sql drivers when configuring and building Qt 6.8.1 from source on linux/Ubuntu 24.04.1:

                      Then what is the case for oracle qoci? I run

                      Why do you want to recompile the complete Qt? Please follow the documentation on how to build a single sql driver: https://doc.qt.io/qt-6/sql-driver.html

                      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

                      • Login

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