Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. How to run project OCI
Forum Updated to NodeBB v4.3 + New Features

How to run project OCI

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
10 Posts 3 Posters 7.9k Views 3 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.
  • P Offline
    P Offline
    paulogp
    wrote on last edited by paulogp
    #1

    Hello,

    I'm trying to compile the project OCI using Qt 5.8 on a Windows 7 - 64 bit machine, compiler VS2015.
    When I open this project (D:\Qt\5.8\Src\qtbase\src\plugins\sqldrivers\oci) the following message is returned immediately: "Project ERROR: Library 'oci' is not defined."

    Oracle installation: D:\Oracle\product\12.1.0\client_1\oci

    • sub directories:
      • include (cpp headers)
      • lib
        • msvc
        • directory: vc10, vc11 and vc12
        • files: oci, ociw32, oraocci12

    Does anyone have faced similar problem and know how to fix it, please?

    Thanks in advance

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

      HI,

      First thing I see (but not related to the current error you have) is that, unless I'm mistaken, you don't have any version of these libs for VS2015.

      Also I'm not yet used to the modifications made to the Qt build system but you may need to set these variables:

      QMAKE_LIBS_OCI
      QMAKE_LIBDIR_OCI
      QMAKE_INCDIR_OCI
      

      or if it doesn't change anything, take a look at the QOCI documentation.

      Hope it helps

      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
      • S Offline
        S Offline
        SH86
        wrote on last edited by SH86
        #3

        I've got the same issue with basically the same setup, just on Windows 8.1 and Oracle 11 (same compiler, same Qt version, similar paths).
        I've set up the LIB and INCLUDE variables properly, but it won't work.

        I've tracked it down to the following line in the oci project file:

        QMAKE_USE += oci
        

        If I replace this line by

        QMAKE_LFLAGS += oci.lib
        

        qmake + nmake run successfully.
        I would prefer being able to translate the plugin without modifications, however.
        Setting the mentioned QMAKE_*_OCI fields does not seem to help unfortunately.

        [Edit:] It obviously works as well if I remove the QMAKE_USE line and call

        qmake "LIBS+=-loci" oci.po
        

        from the command line, but this still requires modifying the Qt sources.

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

          There's QTBUG-58372 that proposes an alternative.

          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
          • S SH86

            I've got the same issue with basically the same setup, just on Windows 8.1 and Oracle 11 (same compiler, same Qt version, similar paths).
            I've set up the LIB and INCLUDE variables properly, but it won't work.

            I've tracked it down to the following line in the oci project file:

            QMAKE_USE += oci
            

            If I replace this line by

            QMAKE_LFLAGS += oci.lib
            

            qmake + nmake run successfully.
            I would prefer being able to translate the plugin without modifications, however.
            Setting the mentioned QMAKE_*_OCI fields does not seem to help unfortunately.

            [Edit:] It obviously works as well if I remove the QMAKE_USE line and call

            qmake "LIBS+=-loci" oci.po
            

            from the command line, but this still requires modifying the Qt sources.

            P Offline
            P Offline
            paulogp
            wrote on last edited by
            #5

            @SH86 said in How to run project OCI:

            er being able to translate the plugin without modifications, however.
            Setting the mentioned QMAKE_*_OCI fields does not seem to help unfo

            You're right. Replacing QMAKE_USE "mutes" the error.

            1 Reply Last reply
            0
            • S Offline
              S Offline
              SH86
              wrote on last edited by
              #6

              We managed to build QSQLOCI now by adding -sql-oci to the configure call when building Qt itself, rather than building the plugin in a separate step (we did this due to problems with earlier Qt versions).

              It seems that the qmake.exe created by the configure call (I believe) defines the available QMAKE_USE options somehow

              P 1 Reply Last reply
              0
              • S SH86

                We managed to build QSQLOCI now by adding -sql-oci to the configure call when building Qt itself, rather than building the plugin in a separate step (we did this due to problems with earlier Qt versions).

                It seems that the qmake.exe created by the configure call (I believe) defines the available QMAKE_USE options somehow

                P Offline
                P Offline
                paulogp
                wrote on last edited by paulogp
                #7

                File oci.pro:

                # file: oci.pro
                TARGET = qsqloci
                
                HEADERS += $$PWD/qsql_oci_p.h
                SOURCES += $$PWD/qsql_oci.cpp $$PWD/main.cpp
                
                # QMAKE_USE += oci  # Library 'oci' is not defined.
                QMAKE_LFLAGS += oci.lib
                
                darwin:QMAKE_LFLAGS += -Wl,-flat_namespace,-U,_environ
                
                OTHER_FILES += oci.json
                
                PLUGIN_CLASS_NAME = QOCIDriverPlugin
                include(../qsqldriverbase.pri)
                

                Directory: D:\Qt\5.8\Src\qtbase\src\plugins\sqldrivers\oci

                Files (project + oracle headers):
                main.cpp
                nzerror.h
                nzt.h
                occi.h
                occiAQ.h
                occiCommon.h
                occiControl.h
                occiData.h
                occiObjects.h
                oci.h
                oci.json
                oci.lib
                oci.pro
                oci.pro.user
                oci1.h
                oci8dp.h
                ociap.h
                ociapr.h
                ocidef.h
                ocidem.h
                ocidfn.h
                ociextp.h
                ocikpr.h
                ociw32.lib
                ocixml.h
                ocixmldb.h
                ocixstream.h
                odci.h
                oraocci12.lib
                oraocci12d.lib
                oratypes.h
                ori.h
                orid.h
                orl.h
                oro.h
                ort.h
                qsql_oci.cpp
                qsql_oci_p.h
                README
                xa.h

                Issues when compiling using Qt Creator 4.2.1:

                C4267: '=': conversion from 'size_t' to 'ub2', possible loss of data
                D:\Qt\5.8\Src\qtbase\src\plugins\sqldrivers\oci\qsql_oci.cpp

                LNK1181: cannot open input file 'oci.lib'

                C4267: '=': conversion from 'size_t' to 'ub2', possible loss of data
                D:\Qt\5.8\Src\qtbase\src\plugins\sqldrivers\oci\qsql_oci.cpp

                LNK1181: cannot open input file 'oci.lib'

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

                  The fact that the lib is in the source folder doesn't mean that the linker can find it.

                  You have to adjust LIBS to give information about the location of the .lib file.

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

                  P 1 Reply Last reply
                  1
                  • SGaistS SGaist

                    The fact that the lib is in the source folder doesn't mean that the linker can find it.

                    You have to adjust LIBS to give information about the location of the .lib file.

                    P Offline
                    P Offline
                    paulogp
                    wrote on last edited by
                    #9

                    @SGaist Can you help on how to do that, please?

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

                      LIBS += -Lpath/to/folder_containing_the_lib_file/

                      A quick look at the LIBS variable documentation would have got you the answer quicker.

                      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

                      • Login

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