Compiling OCI driver
-
Hello, I need help with compiling OCI driver
I am trying to do it about a weekI'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\binTrying 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-makecd 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...
"
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?
-
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.
-
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? -
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.
-
I am back and my problem is still actual
Now I am using Qt 5.11 + MSVC15, ofcourse with MS SDK 8.1
Trying to compile oci.dll I've got two results: "Library 'oci' is not defined" or “Cannot open include file: 'windows.h'”
Using this commands:C: cd C:\Qt\Qt5.11.0\5.11.0\Src\qtbase\src\plugins\sqldrivers\oci qmake -- OCI_INCDIR=C:\oraclexe\app\oracle\product\11.2.0\server\oci\include OCI_LIBDIR=C:\oraclexe\app\oracle\product\11.2.0\server\oci\lib\MSVC nmake
Please, help me to fix this problem
-
Are you doing that in a Visual Studio enabled command line ?
Are you sure that you have the libraries for the correct architecture ?