PDA

View Full Version : Problems in building the OCI plugin using VS 2010 and Qt5.3.2



franco.amato
9th October 2014, 01:22
Hi to all, I have some problem in building the OCI plugin using QT 5.3.2 and VS2010 as compiler.
First of all I downloaded the qt5.3.2 src code and then I followed the instructions listed here:


How to Build the OCI Plugin on Windows
Choosing the option "Programmer" in the Oracle Client Installer from the Oracle Client Installation CD is generally sufficient to build the plugin. For some versions of Oracle Client, you may also need to select the "Call Interface (OCI)" option if it is available.
Build the plugin as follows (here it is assumed that Oracle Client is installed in C:\oracle):
set INCLUDE=%INCLUDE%;c:\oracle\oci\include
set LIB=%LIB%;c:\oracle\oci\lib\msvc
cd %QTDIR%\src\plugins\sqldrivers\oci
qmake oci.pro
nmake

In my case ( I installed Oracle 11g Express edition ), the installation is a bit different (C:\oraclexe\app\oracle\product\11.2.0\server ).
So these are the steps I followed:


1) C:\oraclexe\app\oracle\product\11.2.0\server>set INCLUDE=%INCLUDE%;C:\oraclexe\app\oracle\product\1 1.2.0\server\oci\include
2) C:\oraclexe\app\oracle\product\11.2.0\server>set LIB=%LIB%;C:\oraclexe\app\oracle\product\11.2.0\se rver\oci\lib\MSVC
3) C:\oraclexe\app\oracle\product\11.2.0\server>cd Libs\Qt\Qt5.3.2\5.3\src\qtbase\src\plugins\sqldriv ers\oci
4) qmake oci.pro
5) nmake

And this is the output I got:


Creating library ..\..\..\..\plugins\sqldrivers\qsqloci.lib and object ..\..\..\..\plugins\sqldrivers\qsqloci.exp
qsql_oci.obj : error LNK2019: unresolved external symbol _OCIDescriptorAlloc referenced in function "public: __thiscall QOCIRowId::QOCIRowId(struct OCIEnv *)" (??0QOCIRowId@@QAE@PAUOCIEnv@@@Z)
qsql_oci.obj : error LNK2019: unresolved external symbol _OCIDescriptorFree referenced in function "public: __thiscall QOCIRowId::~QOCIRowId(void)" (??1QOCIRowId@@QAE@XZ)
qsql_oci.obj : error LNK2019: unresolved external symbol _OCIHandleAlloc referenced in function "public: void __thiscall QOCIDriverPrivate::allocErrorHandle(void)" (?allocErrorHandle@QOCIDriverPrivate@@QAEXXZ)
qsql_oci.obj : error LNK2019: unresolved external symbol _OCIErrorGet referenced
in function "class QString __cdecl qOraWarn(struct OCIError *,int *)" (?qOraWarn@@YA?AVQString@@PAUOCIError@@PAH@Z)
qsql_oci.obj : error LNK2019: unresolved external symbol _OCINumberFromInt referenced in function "class QByteArray __cdecl qMakeOCINumber(__int64 const &,struct OCIError *)" (?qMakeOCINumber@@YA?AVQByteArray@@AB_JPAUOCIError @@@Z)
qsql_oci.obj : error LNK2019: unresolved external symbol _OCINumberToInt referenced in function "__int64 __cdecl qMakeLongLong(char const *,struct OCIError *)"(?qMakeLongLong@@YA_JPBDPAUOCIError@@@Z)
qsql_oci.obj : error LNK2019: unresolved external symbol _OCIAttrGet referencedin function "protected: virtual int __thiscall QOCIResult::numRowsAffected(void)" (?nuRowsAffected@QOCIResult@@MAEHXZ)
qsql_oci.obj : error LNK2019: unresolved external symbol _OCILobRead referencedin function "int __cdecl qReadLob<class QString,2>(class QString &,struct QOCIResultPrivate const *,struct OCILobLocator *)" (??$qReadLob@VQString@@$01@@YAHAAVQ
String@@PBUQOCIResultPrivate@@PAUOCILobLocator@@@Z )
qsql_oci.obj : error LNK2019: unresolved external symbol _OCILobGetLength referenced in function "int __cdecl qReadLob<class QString,2>(class QString &,struct QOCIResultPrivate const *,struct OCILobLocator *)" (??qReadLob@VQString@@$01@@YAHAAVQString@@PBUQOCIR esultPrivate@@PAUOCILobLocator@@@Z)
qsql_oci.obj : error LNK2019: unresolved external symbol _OCILobCharSetForm referenced in function "int __cdecl qReadLob<class QString,2>(class QString &,struct
QOCIResultPrivate const *,struct OCILobLocator *)" (??$qReadLob@VQString@@$01@@
YAHAAVQString@@PBUQOCIResultPrivate@@PAUOCILobLoca tor@@@Z)
qsql_oci.obj : error LNK2019: unresolved external symbol _OCIAttrSet referenced
in function "public: void __thiscall QOCIResultPrivate::setCharset(void *,unsign
ed int)const " (?setCharset@QOCIResultPrivate@@QBEXPAXI@Z)
qsql_oci.obj : error LNK2019: unresolved external symbol _OCIEnvCreate reference
d in function "public: __thiscall QOCIDriver::QOCIDriver(class QObject *)" (??0Q
OCIDriver@@QAE@PAVQObject@@@Z)
qsql_oci.obj : error LNK2019: unresolved external symbol _OCIHandleFree referenc
ed in function "public: virtual void __thiscall QOCIDriver::close(void)" (?close
@QOCIDriver@@UAEXXZ)
qsql_oci.obj : error LNK2019: unresolved external symbol _OCIServerDetach refere
nced in function "public: virtual void __thiscall QOCIDriver::close(void)" (?clo
se@QOCIDriver@@UAEXXZ)
qsql_oci.obj : error LNK2019: unresolved external symbol _OCISessionEnd referenc
ed in function "public: virtual void __thiscall QOCIDriver::close(void)" (?close
@QOCIDriver@@UAEXXZ)
qsql_oci.obj : error LNK2019: unresolved external symbol _OCITransStart referenc
ed in function "protected: virtual bool __thiscall QOCIDriver::beginTransaction(
void)" (?beginTransaction@QOCIDriver@@MAE_NXZ)
qsql_oci.obj : error LNK2019: unresolved external symbol _OCITransCommit referen
ced in function "protected: virtual bool __thiscall QOCIDriver::commitTransactio
n(void)" (?commitTransaction@QOCIDriver@@MAE_NXZ)
qsql_oci.obj : error LNK2019: unresolved external symbol _OCITransRollback refer
enced in function "protected: virtual bool __thiscall QOCIDriver::rollbackTransa
ction(void)" (?rollbackTransaction@QOCIDriver@@MAE_NXZ)
qsql_oci.obj : error LNK2019: unresolved external symbol _OCIStmtPrepare referen
ced in function "public: virtual bool __thiscall QOCIResult::prepare(class QStri
ng const &)" (?prepare@QOCIResult@@UAE_NABVQString@@@Z)
qsql_oci.obj : error LNK2019: unresolved external symbol _OCIServerVersion refer
enced in function "public: virtual bool __thiscall QOCIDriver::open(class QStrin
g const &,class QString const &,class QString const &,class QString const &,int,
class QString const &)" (?open@QOCIDriver@@UAE_NABVQString@@000H0@Z)
qsql_oci.obj : error LNK2019: unresolved external symbol _OCISessionBegin refere
nced in function "public: virtual bool __thiscall QOCIDriver::open(class QString
const &,class QString const &,class QString const &,class QString const &,int,c
lass QString const &)" (?open@QOCIDriver@@UAE_NABVQString@@000H0@Z)
qsql_oci.obj : error LNK2019: unresolved external symbol _OCIServerAttach refere
nced in function "public: virtual bool __thiscall QOCIDriver::open(class QString
const &,class QString const &,class QString const &,class QString const &,int,c
lass QString const &)" (?open@QOCIDriver@@UAE_NABVQString@@000H0@Z)
qsql_oci.obj : error LNK2019: unresolved external symbol _OCIStmtFetch reference
d in function "public: int __thiscall QOCICols::readPiecewise(class QVector<clas
s QVariant> &,int)" (?readPiecewise@QOCICols@@QAEHAAV?$QVector@VQVaria nt@@@@H@Z)

qsql_oci.obj : error LNK2019: unresolved external symbol _OCIStmtSetPieceInfo re
ferenced in function "public: int __thiscall QOCICols::readPiecewise(class QVect
or<class QVariant> &,int)" (?readPiecewise@QOCICols@@QAEHAAV?$QVector@VQVaria nt@
@@@H@Z)
qsql_oci.obj : error LNK2019: unresolved external symbol _OCIStmtGetPieceInfo re
ferenced in function "public: int __thiscall QOCICols::readPiecewise(class QVect
or<class QVariant> &,int)" (?readPiecewise@QOCICols@@QAEHAAV?$QVector@VQVaria nt@
@@@H@Z)
qsql_oci.obj : error LNK2019: unresolved external symbol _OCIDefineByPos referen
ced in function "public: __thiscall QOCICols::QOCICols(int,struct QOCIResultPriv
ate *)" (??0QOCICols@@QAE@HPAUQOCIResultPrivate@@@Z)
qsql_oci.obj : error LNK2019: unresolved external symbol _OCIParamGet referenced
in function "public: __thiscall QOCICols::QOCICols(int,struct QOCIResultPrivate
*)" (??0QOCICols@@QAE@HPAUQOCIResultPrivate@@@Z)
qsql_oci.obj : error LNK2019: unresolved external symbol _OCIBindByPos reference
d in function "public: int __thiscall QOCIResultPrivate::bindValue(struct OCIStm
t *,struct OCIBind * *,struct OCIError *,int,class QVariant const &,void *,unsig
ned short *,class QList<class QByteArray> &)" (?bindValue@QOCIResultPrivate@@QAE
HPAUOCIStmt@@PAPAUOCIBind@@PAUOCIError@@HABVQVaria nt@@PAXPAGAAV?$QList@VQByteArr
ay@@@@@Z)
qsql_oci.obj : error LNK2019: unresolved external symbol _OCIStmtExecute referen
ced in function "public: static bool __cdecl QOCICols::execBatch(struct QOCIResu
ltPrivate *,class QVector<class QVariant> &,bool)" (?execBatch@QOCICols@@SA_NPAU
QOCIResultPrivate@@AAV?$QVector@VQVariant@@@@_N@Z)
qsql_oci.obj : error LNK2019: unresolved external symbol _OCIBindArrayOfStruct r
eferenced in function "public: static bool __cdecl QOCICols::execBatch(struct QO
CIResultPrivate *,class QVector<class QVariant> &,bool)" (?execBatch@QOCICols@@S
A_NPAUQOCIResultPrivate@@AAV?$QVector@VQVariant@@@ @_N@Z)
..\..\..\..\plugins\sqldrivers\qsqloci.dll : fatal error LNK1120: 30 unresolved
externals
NMAKE : fatal error U1077: '"c:\Program Files (x86)\Microsoft Visual Studio 10.0
\VC\BIN\link.EXE"' : return code '0x460'
Stop.
NMAKE : fatal error U1077: '"c:\Program Files (x86)\Microsoft Visual Studio 10.0
\VC\BIN\nmake.exe"' : return code '0x2'
Stop.



Can I have some help please? Seems it can not link against the oracle lib.

Regards,
Franco

west
9th October 2014, 09:48
http://qt-project.org/doc/qt-5/sharedlibrary.html