How to use OCI with Qt on OS X ?

  • Hello I'm new to booth QT and oracle but and i've keep falling on building the OCI driver. I found the official documentation at to be booth incomplete and out of date.
    Also I've been using QT only through QTCreator and have no experience with building anything.

    So I downloaded booth the sdk and instant client from oracle and unzipped it then I created the symbolic link as oracle suggest in their site. This is what they call installation of the driver, but i'm not sure.... Then I tried to follow the instructions on the doc

    cd $QTDIR/qtbase/src/plugins/sqldrivers/oci 

    But my qt folders are a bit different. I've installed qt from the installer. But I found the sqldrivers folder on:


    But there was no oci folder there, so I just made on and cded to it and tried

    qmake "INCLUDEPATH+=$ORACLE_HOME/rdbms/public $ORACLE_HOME/rdbms/demo" "LIBS+=-L$ORACLE_HOME/lib -lclntsh -lwtc9"

    Changing booth the include path and libs to the include path inside sdk folder and to the instant client folder itself.
    But then I got an error found saying qmake was not found. Again I found the qmake binary at my qt folder so I tried:

    /Users/myuser/Qt5.7.0/5.7/clang_64/bin/qmake "INCLUDEPATH+=/Users/myuser/instantclient11.2.0.3/sdk/include" "/Users/myuser/instantclient_11_2-4 -lclntsh -lwtc9"

    But then I got the following error

    Cannot find file: /Users/myuser/instantclient_11_2-4 -lclntsh -lwtc9.
    Cannot find file:

    And have no idea how to proceed next. I've googled a lot I found some similar problems mostly on windows but again due to my lack of knowledge I haven´t been able to make any sense of it. So bear mind while answering me that I'm a completely beginner and have no idea by what you mean by something like "add oci to qt path" or that I need to "build oci".
    If possible give me clear and precise instructions otherwise I think i will have to go back to Java for this noooo!
    Is there any other driver that can be used to access an oracle db?

  • Lifetime Qt Champion

    Hi and welcome to devnet,

    First thing: you need to download Qt's sources, you are trying to build the plugin in your installed Qt. The sources can be downloaded through the Maintenance Tool.

    The on your line your are missing LIBS+= for the linking part so your should have something like "LIBS+=-L/Users/myuser/instantclient_11_2-4 -lclntsh -lwtc9"

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.