Errors compiling QOCI Windows 10 x64



  • QT: windows-x86-msvc2013_64-5.4.1
    Compiler: Visual Studio 2013,
    OCI: instantclient-sdk-windows.x64-12.2.0.1.0

    I copiled QOCI for Windows X86 with thisguidance: http://doc.qt.io/qt-5/sql-driver.html. This worked without any problems. No I use the QT x64 version and also the OCI for Windows X64, the compiler I conigured like this: "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" x86_amd64
    But I get a lot of "LNK2019: unresolved external symbol" errors.

    The copile output is:

    Copyright (C) Microsoft Corporation.  All rights reserved.
    
            "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\BIN\nmake.exe" -f Makefile.Release all
    
    Microsoft (R) Program Maintenance Utility Version 12.00.21005.1
    Copyright (C) Microsoft Corporation.  All rights reserved.
    
            link /NOLOGO /DYNAMICBASE /NXCOMPAT oci.lib /INCREMENTAL:NO /DLL /SUBSYSTEM:WINDOWS /VERSION:5.41 /OUT:..\..\..\..\plugins\sqldrivers\qsqloci.dll @C:\Users\VMAdmin\AppData\Local\Temp\nm2FA7.tmp
       Creating library ..\..\..\..\plugins\sqldrivers\qsqloci.lib and object ..\..\..\..\plugins\sqldrivers\qsqloci.exp
    qsql_oci.obj : error LNK2019: unresolved external symbol OCINumberToInt referenced in function "public: void __cdecl QOCICols::getValues(class QVector<class QVariant> &,int)" (?getValues@QOCICols@@QEAAXAEAV?$QVector@VQVariant@@@@H@Z)
    qsql_oci.obj : error LNK2019: unresolved external symbol OCINumberFromInt referenced in function "public: int __cdecl QOCIResultPrivate::bindValue(struct OCIStmt *,struct OCIBind * *,struct OCIError *,int,class QVariant const &,void *,unsigned short *,class QList<class QByteArray> &)" (?bindValue@QOCIResultPrivate@@QEAAHPEAUOCIStmt@@PEAPEAUOCIBind@@PEAUOCIError@@HAEBVQVariant@@PEAXPEAGAEAV?$QList@VQByteArray@@@@@Z)
    qsql_oci.obj : error LNK2019: unresolved external symbol OCIEnvCreate referenced in function "public: __cdecl QOCIDriver::QOCIDriver(class QObject *)" (??0QOCIDriver@@QEAA@PEAVQObject@@@Z)
    qsql_oci.obj : error LNK2019: unresolved external symbol OCIHandleAlloc referenced in function "public: __cdecl QOCIDriver::QOCIDriver(struct OCIEnv *,struct OCISvcCtx *,class QObject *)" (??0QOCIDriver@@QEAA@PEAUOCIEnv@@PEAUOCISvcCtx@@PEAVQObject@@@Z)
    qsql_oci.obj : error LNK2019: unresolved external symbol OCIHandleFree referenced in function "public: virtual __cdecl QOCIDriver::~QOCIDriver(void)" (??1QOCIDriver@@UEAA@XZ)
    qsql_oci.obj : error LNK2019: unresolved external symbol OCIDescriptorAlloc referenced in function "public: __cdecl QOCIRowId::QOCIRowId(struct OCIEnv *)" (??0QOCIRowId@@QEAA@PEAUOCIEnv@@@Z)
    qsql_oci.obj : error LNK2019: unresolved external symbol OCIDescriptorFree referenced in function "public: __cdecl QSharedDataPointer<class QOCIRowId>::~QSharedDataPointer<class QOCIRowId>(void)" (??1?$QSharedDataPointer@VQOCIRowId@@@@QEAA@XZ)
    qsql_oci.obj : error LNK2019: unresolved external symbol OCIServerAttach referenced in function "public: virtual bool __cdecl QOCIDriver::open(class QString const &,class QString const &,class QString const &,class QString const &,int,class QString const &)" (?open@QOCIDriver@@UEAA_NAEBVQString@@000H0@Z)
    qsql_oci.obj : error LNK2019: unresolved external symbol OCIServerDetach referenced in function "public: virtual void __cdecl QOCIDriver::close(void)" (?close@QOCIDriver@@UEAAXXZ)
    qsql_oci.obj : error LNK2019: unresolved external symbol OCISessionBegin referenced in function "public: virtual bool __cdecl QOCIDriver::open(class QString const &,class QString const &,class QString const &,class QString const &,int,class QString const &)" (?open@QOCIDriver@@UEAA_NAEBVQString@@000H0@Z)
    qsql_oci.obj : error LNK2019: unresolved external symbol OCISessionEnd referenced in function "public: virtual void __cdecl QOCIDriver::close(void)" (?close@QOCIDriver@@UEAAXXZ)
    qsql_oci.obj : error LNK2019: unresolved external symbol OCIStmtPrepare referenced in function "public: virtual bool __cdecl QOCIResult::prepare(class QString const &)" (?prepare@QOCIResult@@UEAA_NAEBVQString@@@Z)
    qsql_oci.obj : error LNK2019: unresolved external symbol OCIBindByPos referenced in function "public: int __cdecl QOCIResultPrivate::bindValue(struct OCIStmt *,struct OCIBind * *,struct OCIError *,int,class QVariant const &,void *,unsigned short *,class QList<class QByteArray> &)" (?bindValue@QOCIResultPrivate@@QEAAHPEAUOCIStmt@@PEAPEAUOCIBind@@PEAUOCIError@@HAEBVQVariant@@PEAXPEAGAEAV?$QList@VQByteArray@@@@@Z)
    qsql_oci.obj : error LNK2019: unresolved external symbol OCIBindArrayOfStruct referenced in function "public: static bool __cdecl QOCICols::execBatch(struct QOCIResultPrivate *,class QVector<class QVariant> &,bool)" (?execBatch@QOCICols@@SA_NPEAUQOCIResultPrivate@@AEAV?$QVector@VQVariant@@@@_N@Z)
    qsql_oci.obj : error LNK2019: unresolved external symbol OCIStmtGetPieceInfo referenced in function "public: int __cdecl QOCICols::readPiecewise(class QVector<class QVariant> &,int)" (?readPiecewise@QOCICols@@QEAAHAEAV?$QVector@VQVariant@@@@H@Z)
    qsql_oci.obj : error LNK2019: unresolved external symbol OCIStmtSetPieceInfo referenced in function "public: int __cdecl QOCICols::readPiecewise(class QVector<class QVariant> &,int)" (?readPiecewise@QOCICols@@QEAAHAEAV?$QVector@VQVariant@@@@H@Z)
    qsql_oci.obj : error LNK2019: unresolved external symbol OCIStmtExecute referenced in function "public: virtual bool __cdecl QOCIResult::exec(void)" (?exec@QOCIResult@@UEAA_NXZ)
    qsql_oci.obj : error LNK2019: unresolved external symbol OCIDefineByPos referenced in function "public: __cdecl QOCICols::QOCICols(int,struct QOCIResultPrivate *)" (??0QOCICols@@QEAA@HPEAUQOCIResultPrivate@@@Z)
    qsql_oci.obj : error LNK2019: unresolved external symbol OCIStmtFetch referenced in function "protected: virtual bool __cdecl QOCIResult::gotoNext(class QVector<class QVariant> &,int)" (?gotoNext@QOCIResult@@MEAA_NAEAV?$QVector@VQVariant@@@@H@Z)
    qsql_oci.obj : error LNK2019: unresolved external symbol OCIParamGet referenced in function "public: __cdecl QOCICols::QOCICols(int,struct QOCIResultPrivate *)" (??0QOCICols@@QEAA@HPEAUQOCIResultPrivate@@@Z)
    qsql_oci.obj : error LNK2019: unresolved external symbol OCITransStart referenced in function "protected: virtual bool __cdecl QOCIDriver::beginTransaction(void)" (?beginTransaction@QOCIDriver@@MEAA_NXZ)
    qsql_oci.obj : error LNK2019: unresolved external symbol OCITransCommit referenced in function "protected: virtual bool __cdecl QOCIDriver::commitTransaction(void)" (?commitTransaction@QOCIDriver@@MEAA_NXZ)
    qsql_oci.obj : error LNK2019: unresolved external symbol OCITransRollback referenced in function "protected: virtual bool __cdecl QOCIDriver::rollbackTransaction(void)" (?rollbackTransaction@QOCIDriver@@MEAA_NXZ)
    qsql_oci.obj : error LNK2019: unresolved external symbol OCIErrorGet referenced in function "public: __cdecl QOCIDriver::QOCIDriver(class QObject *)" (??0QOCIDriver@@QEAA@PEAVQObject@@@Z)
    qsql_oci.obj : error LNK2019: unresolved external symbol OCILobCharSetForm referenced in function "int __cdecl qReadLob<class QByteArray,1>(class QByteArray &,struct QOCIResultPrivate const *,struct OCILobLocator *)" (??$qReadLob@VQByteArray@@$00@@YAHAEAVQByteArray@@PEBUQOCIResultPrivate@@PEAUOCILobLocator@@@Z)
    qsql_oci.obj : error LNK2019: unresolved external symbol OCILobGetLength referenced in function "int __cdecl qReadLob<class QByteArray,1>(class QByteArray &,struct QOCIResultPrivate const *,struct OCILobLocator *)" (??$qReadLob@VQByteArray@@$00@@YAHAEAVQByteArray@@PEBUQOCIResultPrivate@@PEAUOCILobLocator@@@Z)
    qsql_oci.obj : error LNK2019: unresolved external symbol OCILobRead referenced in function "int __cdecl qReadLob<class QByteArray,1>(class QByteArray &,struct QOCIResultPrivate const *,struct OCILobLocator *)" (??$qReadLob@VQByteArray@@$00@@YAHAEAVQByteArray@@PEBUQOCIResultPrivate@@PEAUOCILobLocator@@@Z)
    qsql_oci.obj : error LNK2019: unresolved external symbol OCIServerVersion referenced in function "public: virtual bool __cdecl QOCIDriver::open(class QString const &,class QString const &,class QString const &,class QString const &,int,class QString const &)" (?open@QOCIDriver@@UEAA_NAEBVQString@@000H0@Z)
    qsql_oci.obj : error LNK2019: unresolved external symbol OCIAttrGet referenced in function "public: virtual bool __cdecl QOCIResult::exec(void)" (?exec@QOCIResult@@UEAA_NXZ)
    qsql_oci.obj : error LNK2019: unresolved external symbol OCIAttrSet referenced in function "public: virtual bool __cdecl QOCIDriver::open(class QString const &,class QString const &,class QString const &,class QString const &,int,class QString const &)" (?open@QOCIDriver@@UEAA_NAEBVQString@@000H0@Z)
    ..\..\..\..\plugins\sqldrivers\qsqloci.dll : fatal error LNK1120: 30 unresolved externals
    //your code here
    

    Can anybody tell me what I am doing wrong?

    I am thankful for every help.



  • I found the problem. I use now the Visual Studio 2015 Compiler and QT 5.10. Now I can compile without any error.



  • @Rudl great! please don't forget to mark this post as solved. Thanks.


Log in to reply
 

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