Compiling OCI driver



  • Hello, I need help with compiling OCI driver
    I am trying to do it about a week

    I've got 2 Oracle clients: Instant 11.2.0 and Express 11g
    Working at Qt 5.9.1
    PATH=D:\Qt\5.9.1\mingw53_32\bin;D:\VS\VC\bin;D:\Qt\Tools\mingw530_32\bin

    Trying to compile drivers with next ways:

    cd D:\Qt\5.9.1\Src\qtbase\src\plugins\sqldrivers\oci
    qmake -- OCI_INCDIR=D:\app\Master\product\11.2.0\client_1\oci\include OCI_LIBDIR=-LD:\app\Master\product\11.2.0\client_1\oci\lib\msvc
    nmake or mingw32-make

    cd D:\Qt\5.9.1\Src\qtbase\src\plugins\sqldrivers\oci
    qmake "INCLUDEPATH+=D:\app\Master\product\11.2.0\client_1\oci\include" "LIBS+=-LD:\app\Master\product\11.2.0\client_1\oci\lib\msvc -loci" oci.pro
    nmake or mingw32-make
    
    cd D:\Qt\5.9.1\Src\qtbase\src\plugins\sqldrivers\oci
    qmake "INCLUDEPATH+=C:\oraclexe\app\oracle\product\11.2.0\server\oci\include" "LIBS+=-LC:\oraclexe\app\oracle\product\11.2.0\server\oci\lib\MSVC -loci" oci.pro
    nmake or mingw32-make
    

    As a result, I have big pack of "undefined reference to OCI..."
    0_1523647681227_references.png

    My OCI.pro

    TARGET = qsqloci
    
    HEADERS += $$PWD/qsql_oci_p.h
    SOURCES += $$PWD/qsql_oci.cpp $$PWD/main.cpp
    
    QMAKE_USE += oci
    
    darwin:QMAKE_LFLAGS += -Wl,-flat_namespace,-U,_environ
    
    OTHER_FILES += oci.json
    
    PLUGIN_CLASS_NAME = QOCIDriverPlugin
    include(../qsqldriverbase.pri)
    

    What should I do to get this driver?


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    Looks like you are trying to link an MSVC built library to a MinGW build of Qt. Unless it's pure C code, that's not possible. You should also check the architecture of the library you are trying to link to.



  • Probably, I've tryed to do it with VC15 nmake via Win cmd and VC15 cmd
    Result:
    0_1523823904390_15042.png
    Which specifically file should I check?


  • Lifetime Qt Champion

    From the log you posted, you are still using MinGW.

    You should also check whether that library is 32 or 64 bit.



  • Sorry for stupid questions, I am new at this.
    I am looking at other topicks, and there's driver compiled by minGW with the same method
    So I should add VC cmp & dbg into project?
    Cause I trying to complie with nmake, but it refers to g++
    Now I've got Qt5.9.1( MinGW5.3.0 and MSVC15) and Oracle 11gR2 as Runtime
    Wha should I do next?


  • Lifetime Qt Champion

    The key word is coherence: you can't mix and match C++ libraries built with different compilers on Windows. The only exception currently is VS2017 that is compatible with VS2015.

    So what I'm suggesting is that you ensure that you have your dependencies built using the same compiler as your Qt version and for the same architecture.


Log in to reply
 

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