Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Compiling OCI driver
Zipazar last edited by Zipazar
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
Trying to compile drivers with next ways:
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
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.
Probably, I've tryed to do it with VC15 nmake via Win cmd and VC15 cmd
Which specifically file should I check?
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 ?
elgolondrino last edited by elgolondrino