Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Unsolved QT5.6 + OSX: QOCI driver not loaded but available

    General and Desktop
    3
    6
    2222
    Loading More Posts
    • 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.
    • zolotukhin
      zolotukhin last edited by

      OSX: 10.11.4
      QT: 5.6
      Oracle: 11.2 64-bit

      Trying to create simple application with Oracle connection. libqsqloci is created successfully (thanks for manual), libqsqloci.dylib is locating in clang_64/plugins/sqldrivers

      .pro file:

      QT += core gui sql

      .cpp file:

      #include <QSqlDatabase>

      ...

      QSqlDatabase db = QSqlDatabase::addDatabase("QOCI");

      Application starts... and I see error:

      QSqlDatabase: QOCI driver not loaded
      QSqlDatabase: available drivers: QSQLITE QMYSQL QMYSQL3 QOCI QOCI8 QODBC QODBC3 QPSQL QPSQL7

      I not found anything working solution, so decide to ask here. Thank you

      1 Reply Last reply Reply Quote 0
      • SGaist
        SGaist Lifetime Qt Champion last edited by

        Hi and welcome to devnet,

        Do you have the OCI libraries installed on your system ? More information about them here

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

        zolotukhin 1 Reply Last reply Reply Quote 0
        • zolotukhin
          zolotukhin @SGaist last edited by

          @SGaist Thanks for reply. OCI libraries is installed, tnsnames is created, sqlplus is working successfully.

          My zshrc:
          export PATH=/usr/local/bin:$PATH
          export ORACLE_HOME=/Volumes/Data/Oracle/instantclient_11_2
          export LD_LIBRARY_PATH=$ORACLE_HOME
          export DYLD_LIBRARY_PATH=$ORACLE_HOME
          export TNS_ADMIN=$ORACLE_HOME/network/admin
          export OCI_HOME=$ORACLE_HOME
          export OCI_INCLUDE_DIR=$ORACLE_HOME/sdk/include
          export OCI_VERSION=11
          export NLS_LANG=AMERICAN_AMERICA.CL8MSWIN1251
          export PATH=$ORACLE_HOME:$PATH
          export CLASSPATH=$ORACLE_HOME:$PATH

          export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME:/Volumes/Data/Qt5.6.0/5.6/clang_64/plugins/sqldrivers/

          1 Reply Last reply Reply Quote 0
          • SGaist
            SGaist Lifetime Qt Champion last edited by

            Then you should run otool -L on the Qt OCI plugin to see if it is missing something.

            By the way, there's no need to put Qt's plugins folder in the LD_LIBRARY_PATH.

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

            O 1 Reply Last reply Reply Quote 1
            • O
              OAmila @SGaist last edited by

              @SGaist

              I am new to QT, Can you please tell me how to run otool -L

              1 Reply Last reply Reply Quote 0
              • SGaist
                SGaist Lifetime Qt Champion last edited by

                Hi,

                otool has nothing to do with Qt. It's a macOS tool. Calling otool in your command prompt would have shown you have to use it faster than waiting on an answer here.

                otool -L /path/to/library_or_executable

                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 Reply Quote 2
                • First post
                  Last post