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. Building OCI plugin on Windows

Building OCI plugin on Windows

Scheduled Pinned Locked Moved Solved General and Desktop
oci
4 Posts 2 Posters 409 Views
  • 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.
  • Z Offline
    Z Offline
    Zapelniczek
    wrote on last edited by Zapelniczek
    #1

    Hello, i am trying to install QOCI plugin on Windows x64 using this guide: https://doc.qt.io/qt-5/sql-driver.html#how-to-build-the-oci-plugin-on-windows.

    So far what i have done is:

    1.Downloaded source files and msvc2019 prebuilt components via maintenance tool.

    2.Downloaded oracle instant client and instant client sdk (for windows).

    3.I added following environment variables (in system variables category):
    a) Path = C:\oracle\instantclient_19_11
    b) Path = F:\Qt\6.1.2\msvc2019_64\bin

    1. Then i ran Qt 6.1.2 msvc 2019 x64 - cmd

    5.I wrote following command:
    a) cd F:\Qt\6.1.2\Src\qtbase\src\plugins\sqldrivers
    b) qmake -- OCI_INCDIR=C:\oracle\instantclient_19_11\sdk\include OCI_LIBDIR=C:\oracle\instantclient_19_11\sdk\lib\msvc

    The problem is that the last wrote command does nothing after executing it, it shows output equivalent to qmake -help. How can i fix it ?

    Edit: I've noticed that in version 6.1.2 some source files are missing i will try do it again on previous version.

    1 Reply Last reply
    0
    • Z Offline
      Z Offline
      Zapelniczek
      wrote on last edited by Zapelniczek
      #2

      After downgrading to version Qt 5.15.2 and adding additional environment variable:
      Path = C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30037\bin\Hostx64\x64.
      I was able to run qmake but it gave me the following output:

      Qt Sql Drivers:
        DB2 (IBM) .............................. no
        InterBase .............................. no
        MySql .................................. no
        OCI (Oracle) ........................... no
        ODBC ................................... no
        PostgreSQL ............................. no
        SQLite2 ................................ no
        SQLite ................................. yes
          Using system provided SQLite ......... no
        TDS (Sybase) ........................... no
      

      And here is the code from config.log:

      Command line: "OCI_INCDIR=C:\oracle\instantclient_19_11\sdk\include" "OCI_LIBDIR=C:\oracle\instantclient_19_11\sdk\lib\msvc"
      Global lib dirs: [C:\\opensslx86\\lib C:\\Utils\\my_sql\\mysql-5.7.25-win32\\lib C:\\Utils\\postgresqlx86\\pgsql\\lib] ["C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.29.30133\\ATLMFC\\lib\\x86" "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.29.30133\\lib\\x86" "C:\\Program Files (x86)\\Windows Kits\\NETFXSDK\\4.8\\lib\\um\\x86" "C:\\Program Files (x86)\\Windows Kits\\10\\lib\\10.0.19041.0\\ucrt\\x86" "C:\\Program Files (x86)\\Windows Kits\\10\\lib\\10.0.19041.0\\um\\x86"]
      Global inc dirs: [C:\\opensslx86\\include C:\\Utils\\my_sql\\mysql-5.7.25-win32\\include C:\\Utils\\postgresqlx86\\pgsql\\include] ["C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.29.30133\\ATLMFC\\include" "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.29.30133\\include" "C:\\Program Files (x86)\\Windows Kits\\NETFXSDK\\4.8\\include\\um" "C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.19041.0\\ucrt" "C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.19041.0\\shared" "C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.19041.0\\um" "C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.19041.0\\winrt" "C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.19041.0\\cppwinrt"]
      ....
      Trying source 0 (type inline) of library oci ...
      + cd /d F:\Qt\5.15.2\Src\qtbase\src\plugins\sqldrivers\config.tests\oci && F:\Qt\5.15.2\msvc2019_64\bin\qmake.exe "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += shared warn_off console single_arch" "QMAKE_LIBDIR += C:\\openssl\\lib C:\\Utils\\my_sql\\mysql-5.7.25-winx64\\lib C:\\Utils\\postgresql\\pgsql\\lib" "INCLUDEPATH += C:\\openssl\\include C:\\Utils\\my_sql\\mysql-5.7.25-winx64\\include C:\\Utils\\postgresql\\pgsql\\include" "QMAKE_USE += oci" "QMAKE_LIBS_OCI = -LC:\\oracle\\instantclient_19_11\\sdk\\lib\\msvc -loci" "QMAKE_INCDIR_OCI = C:\\oracle\\instantclient_19_11\\sdk\\include" F:/Qt/5.15.2/Src/qtbase/src/plugins/sqldrivers/config.tests/oci
      > Info: creating stash file F:\Qt\5.15.2\Src\qtbase\src\plugins\sqldrivers\config.tests\.qmake.stash
      + cd /d F:\Qt\5.15.2\Src\qtbase\src\plugins\sqldrivers\config.tests\oci && set MAKEFLAGS=& nmake
      > Microsoft (R) Program Maintenance Utility Version 14.29.30038.1
      > Copyright (C) Microsoft Corporation.  All rights reserved.
      > 	cl -c -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zc:__cplusplus -O2 -MD -W0 -EHsc -DUNICODE -D_UNICODE -DWIN32 -D_ENABLE_EXTENDED_ALIGNED_STORAGE -DWIN64 -DNDEBUG -I. -IC:\openssl\include -IC:\Utils\my_sql\mysql-5.7.25-winx64\include -IC:\Utils\postgresql\pgsql\include -IC:\oracle\instantclient_19_11\sdk\include -IF:\Qt\5.15.2\msvc2019_64\mkspecs\win32-msvc -Fo @C:\Users\grzech\AppData\Local\Temp\nm8590.tmp
      > main.cpp
      > C:\oracle\instantclient_19_11\sdk\include\oratypes.h(18): fatal error C1083: Cannot open include file: 'stddef.h': No such file or directory
      > NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30037\bin\Hostx64\x64\cl.EXE"' : return code '0x2'
      > Stop.
       => source failed verification.
      Trying source 1 (type inline) of library oci ...
        => source failed condition '!config.win32'.
      test config.sqldrivers.libraries.oci FAILED
      

      According to this thread https://forum.qt.io/topic/96592/building-oci-plugin-on-windows/2 it is possible to downgrade even further to make it work but is it possible to do it on version 5.15.2 ?

      Edit: According to error from config.log i am missing file 'stddef.h'. I've tried to install windows sdk via visual studio installer and manually but the error still occurs. I've also checked whether the system variable is set ( it is set at Path = C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit).
      Edit2: I've also ran the vcvars64.bat script to set my environment variables correctly but it still doesn't work.

      1 Reply Last reply
      0
      • Z Offline
        Z Offline
        Zapelniczek
        wrote on last edited by Zapelniczek
        #3

        After deleting file config.cache i was able to build correctly plugin. Plus i had to switch to 32x compiler and qmake to get rid of linking errors for some reason qmake only linked 32x libraries from enviornment variables. Problem solved.

        SGaistS 1 Reply Last reply
        0
        • Z Zapelniczek

          After deleting file config.cache i was able to build correctly plugin. Plus i had to switch to 32x compiler and qmake to get rid of linking errors for some reason qmake only linked 32x libraries from enviornment variables. Problem solved.

          SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Hi,

          @Zapelniczek said in Building OCI plugin on Windows:

          After deleting file config.cache i was able to build correctly plugin. Plus i had to switch to 32x compiler and qmake to get rid of linking errors for some reason qmake only linked 32x libraries from enviornment variables. Problem solved.

          Likely because only the 32bit versions of the dependencies are located where your environment variables points them.

          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