How to create the plugin for OCI in RHEL 7 Linux
-
I am developing a RHEL 7 Qt application and need to connect to an Oracle database. When calling QSqlDatabase::addDatabase("QOCI"), I am prompted with the following:
QSqlDatabase: QOCI driver not loaded QSqlDatabase: available drivers: QSQLITE
I have Oracle Install Client v11.2 installed, but I'm not sure where to go from here. I've done extensive research and cannot find a solution. Any help is appreciated!
Based on what I saw online, I tried creating an oci directory within my Qt dir (/usr/lib64/qt5/plugins/sqldrivers) and then created an oci.pro file. Its contents are below:
INCLUDEPATH+=/usr/include/oracle/11.2/client LIBS+=-L/usr/lib/oracle/11.2/client/lib -lclntsh TEMPLATE = subdirs
I ran qmake-qt5 on this to generate a Makefile, but when I run make, the necessary QOCI .so file is not generated. Help please!
-
The instructions are here.
You need the Qt sources that matches the Qt library you are using.
The appropriate version of the qtbase/src/plugins/sqldrivers/oci/ folder contains the source code for the plugin, including the PRO file (and CMakeLists.txt in Qt 6+). -
The instructions are here.
You need the Qt sources that matches the Qt library you are using.
The appropriate version of the qtbase/src/plugins/sqldrivers/oci/ folder contains the source code for the plugin, including the PRO file (and CMakeLists.txt in Qt 6+). -
@Essac said in How to create the plugin for OCI in RHEL 7 Linux:
I had to create that directory and the oci.pro myself.
If you want to compile a qt sql plugin you will need the qt sources.