Qt5.14 compile QOCI driver on Linux -error [Cannot read /qtsqldrivers-config.pri:]
-
I had compiled one QOCI driver(got qsqloci.dll and qsqlocid.dll)on windows10.
Official doc (qmake console) not work for me:How to Build the OCI Plugin on Unix and macOS
here is my environment:
QT VERSION:QT 5.14.0 Linux x64
SYSTEM:Debian 10 x64
DATABASE:Oracle 11g x64 (server on windows10)
I had installed Oracle Instant Client (Base + SDK +SQLPLUS)on Debian, here is my edited [oci.pro] file
qmake error and it said:
run it and crash:
There is no qtsqldrivers-config.pri ,What can I do to find it ,or I did wrong at the very start ?
Thank you so much for seeing my trouble. -
@Christian-Ehrlicher @jsulm
Thank you very very much.
I do not know how to clean qmake file,but I use VM,back to where I start to qmake.
Just a small mistake,took me lots of time.I did not alter the doc example word(-lnnz10)to my current oracle version(-lnnz11)*/opt/Qt5.14.0/5.14.0/gcc_64/bin/qmake -- OCI_INCDIR=/usr/include/oracle/11.2/client64 OCI_LIBDIR=/usr/lib/oracle/11.2/client64/lib OCI_LIBS="-Wl,-rpath,/usr/lib/oracle/11.2/client64/lib -lclntsh -lnnz10"*
/opt/Qt5.14.0/5.14.0/gcc_64/bin/qmake -- OCI_INCDIR=/usr/include/oracle/11.2/client64 OCI_LIBDIR=/usr/lib/oracle/11.2/client64/lib OCI_LIBS="-Wl,-rpath,/usr/lib/oracle/11.2/client64/lib -lclntsh -lnnz11"
Running configuration tests...
Checking for DB2 (IBM)... no
Checking for InterBase... no
Checking for MySQL... no
Checking for OCI (Oracle)... yes
Checking for ODBC... no
Checking for PostgreSQL... no
Checking for SQLite (version 2)... no
Checking for TDS (Sybase)... no
Done running configuration tests.Configure summary:
Qt Sql Drivers:
DB2 (IBM) .............................. no
InterBase .............................. no
MySql .................................. no
OCI (Oracle) ........................... yes
ODBC ................................... no
PostgreSQL ............................. no
SQLite2 ................................ no
SQLite ................................. yes
Using system provided SQLite ......... no
TDS (Sybase) ........................... noQt is now configured for building. Just run 'make'.
Once everything is built, you must run 'make install'.
Qt will be installed into '/opt/Qt5.14.0/5.14.0/gcc_64'.Prior to reconfiguration, make sure you remove any leftovers from
the previous build.just make
using:qDebug()<<QSqlDatabase::drivers();
console:{
QStandardPaths: wrong ownership on runtime directory /run/user/1000, 1000 instead of 0
("QSQLITE", "QOCI", "QOCI8", "QODBC", "QODBC3", "QPSQL", "QPSQL7")} -
Please do not edit anything but follow the documentation
-
@Christian-Ehrlicher ,Thank you for reply!
Had restored qtoci files,reinstall Oracle Instant Client.Did as doc said,qmake :
OCI_INDIR and OCI_LIBDIR ,files are exist:
found this in configure.log:g++ -c -pipe -O2 -w -fPIC -I. -I/home/qt/openssl-1.1.1d/include -I/opt/Qt5.14.0/5.14.0/gcc_64/mkspecs/linux-g++ -o main.o main.cpp
main.cpp:2:10: fatal error: sybfront.h: no file or url
#include <sybfront.h>
^~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:521:main.o]
=> source failed verification.
test config.sqldrivers.libraries.tds FAILEDbuild oci only
-
@Sam_Qoo said in Qt5.14 compile QOCI driver on Linux -error [Cannot read /qtsqldrivers-config.pri:]:
main.cpp:2:10: fatal error: sybfront.h: no file or url
Install freetds-dev package
-
First: no need to use sudo
Second: Please take a look in the config log and search for oracle, not sybase when you want to compile the orcale driver -
This post is deleted!
-
@Christian-Ehrlicher @jsulm Thank you ,but I do not want a TDS driver...
Here is error of oracle in config.log:
and compile oci only
-
@Sam_Qoo said in Qt5.14 compile QOCI driver on Linux -error [Cannot read /qtsqldrivers-config.pri:]:
but I do not want a TDS driver...
I know - and as you can see the Oracle driver is not found - take a look into the config.log if the include and lib paths you give are correctly used - looks like this is not the case. And please do not post screenshots - it makes reading the whole stuff very complicated for me.
Don't know why you try to call make when the config output tells you that oci was not found though.
Please also start over with a clean build dir. -
@Christian-Ehrlicher @jsulm
Thank you very very much.
I do not know how to clean qmake file,but I use VM,back to where I start to qmake.
Just a small mistake,took me lots of time.I did not alter the doc example word(-lnnz10)to my current oracle version(-lnnz11)*/opt/Qt5.14.0/5.14.0/gcc_64/bin/qmake -- OCI_INCDIR=/usr/include/oracle/11.2/client64 OCI_LIBDIR=/usr/lib/oracle/11.2/client64/lib OCI_LIBS="-Wl,-rpath,/usr/lib/oracle/11.2/client64/lib -lclntsh -lnnz10"*
/opt/Qt5.14.0/5.14.0/gcc_64/bin/qmake -- OCI_INCDIR=/usr/include/oracle/11.2/client64 OCI_LIBDIR=/usr/lib/oracle/11.2/client64/lib OCI_LIBS="-Wl,-rpath,/usr/lib/oracle/11.2/client64/lib -lclntsh -lnnz11"
Running configuration tests...
Checking for DB2 (IBM)... no
Checking for InterBase... no
Checking for MySQL... no
Checking for OCI (Oracle)... yes
Checking for ODBC... no
Checking for PostgreSQL... no
Checking for SQLite (version 2)... no
Checking for TDS (Sybase)... no
Done running configuration tests.Configure summary:
Qt Sql Drivers:
DB2 (IBM) .............................. no
InterBase .............................. no
MySql .................................. no
OCI (Oracle) ........................... yes
ODBC ................................... no
PostgreSQL ............................. no
SQLite2 ................................ no
SQLite ................................. yes
Using system provided SQLite ......... no
TDS (Sybase) ........................... noQt is now configured for building. Just run 'make'.
Once everything is built, you must run 'make install'.
Qt will be installed into '/opt/Qt5.14.0/5.14.0/gcc_64'.Prior to reconfiguration, make sure you remove any leftovers from
the previous build.just make
using:qDebug()<<QSqlDatabase::drivers();
console:{
QStandardPaths: wrong ownership on runtime directory /run/user/1000, 1000 instead of 0
("QSQLITE", "QOCI", "QOCI8", "QODBC", "QODBC3", "QPSQL", "QPSQL7")}