Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Compiling OCI driver
Forum Updated to NodeBB v4.3 + New Features

Compiling OCI driver

Scheduled Pinned Locked Moved Unsolved General and Desktop
9 Posts 3 Posters 2.5k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • ZipazarZ Offline
    ZipazarZ Offline
    Zipazar
    wrote on last edited by Zipazar
    #1

    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?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      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.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1
      • ZipazarZ Offline
        ZipazarZ Offline
        Zipazar
        wrote on last edited by
        #3

        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?

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

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

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

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • ZipazarZ Offline
            ZipazarZ Offline
            Zipazar
            wrote on last edited by
            #5

            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?

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              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.

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0
              • ZipazarZ Offline
                ZipazarZ Offline
                Zipazar
                wrote on last edited by
                #7

                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

                1 Reply Last reply
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  Are you doing that in a Visual Studio enabled command line ?
                  Are you sure that you have the libraries for the correct architecture ?

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  1 Reply Last reply
                  0
                  • E Offline
                    E Offline
                    elgolondrino
                    wrote on last edited by elgolondrino
                    #9

                    Did anybody solve the issue?
                    @SGaist What do you advice?
                    @Zipazar Did you solve the problem?
                    Can you help me?

                    1 Reply Last reply
                    0

                    • Login

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • Users
                    • Groups
                    • Search
                    • Get Qt Extensions
                    • Unsolved