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. How to create the plugin for OCI in RHEL 7 Linux

How to create the plugin for OCI in RHEL 7 Linux

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 3 Posters 656 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.
  • E Offline
    E Offline
    Essac
    wrote on last edited by
    #1

    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!

    1 Reply Last reply
    0
    • C Offline
      C Offline
      ChrisW67
      wrote on last edited by
      #2

      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+).

      E 1 Reply Last reply
      1
      • C ChrisW67

        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+).

        E Offline
        E Offline
        Essac
        wrote on last edited by
        #3

        @ChrisW67 Is there supposed to be an oci folder within sqldrivers by default? I had to create that directory and the oci.pro myself.

        Christian EhrlicherC 1 Reply Last reply
        0
        • E Essac

          @ChrisW67 Is there supposed to be an oci folder within sqldrivers by default? I had to create that directory and the oci.pro myself.

          Christian EhrlicherC Offline
          Christian EhrlicherC Offline
          Christian Ehrlicher
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @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.

          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