Can't load sql drivers when configuring and building Qt 6.8.1 from source on linux/Ubuntu 24.04.1
-
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.
-
@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
-
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
-
@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.
-
K KingWm has marked this topic as solved on
-
@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.
-
@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.
-
@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.
-
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 theclient_1
directory -
@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