Qt Build 5.9.1 Static with OCI Driver



  • Hi all

    I want to build Qt 5.9.1 in static with the support of OCI driver.

    I configure it with :

    -static -debug-and-release -platform win32-g++ -prefix D:\Qt\5.9.1\5.9.1\Static -opensource -confirm-license -c++std c++14 -nomake examples -skip qtdoc -skip wayland -skip purchasing -skip serialbus -skip qtserialport -skip script -skip scxml -skip speech -skip location -no-opengl -no-angle -qt-zlib -qt-pcre -qt-libpng -no-libjpeg -qt-freetype -sql-oci "OCI_INCDIR=D:\app\013798432\product\11.2.0\client_1\oci\include" "OCI_LIBDIR=D:\app\013798432\product\11.2.0\client_1\oci\lib\msvc" "OCI_LIBS=-loci -lociw32 -loraocci11"
    

    But I have the following error :

    ERROR: Feature 'sql-oci' was enabled, but the pre-condition 'libs.oci' failed.
    

    I also add the INCLUDE path and LIB path in the system environment

    How can I do to compil Qt statically with the OCI support ?


  • Moderators

    @Slane Add -v parameter to configure and try again: you should then see why exactly it fails.



  • @jsulm I have no more informations on this error with verbose


  • Lifetime Qt Champion

    Hi,

    I'd try with replacing your OCI_* variables with -I "D:\app\013798432\product\11.2.0\client_1\oci\include" and -L "D:\app\013798432\product\11.2.0\client_1\oci\lib\msvc" the space is on purpose.

    Hope it helps



  • @SGaist

    configure.bat -v -static -debug-and-release -platform win32-g++ -prefix D:\Qt\5.9.1\5.9.1\Static -opensource -confirm-license -c++std c++14 -nomake examples -skip qtdoc -skip wayland -skip purchasing -skip serialbus -skip qtserialport -skip script -skip scxml -skip speech -skip location -no-opengl -no-angle -qt-zlib -qt-pcre -qt-libpng -no-libjpeg -qt-freetype -sql-oci -I "D:\app\013798432\product\11.2.0\client_1\oci\include" -L "D:\app\013798432\product\11.2.0\client_1\oci\lib\msvc"
    

    unfortunately same result


  • Lifetime Qt Champion

    Since you have the -v option, did you catch the error message related to OCI ?



  • @SGaist No i Haven't more information with -v

    But for compiling the OCI in dynamic, I had made some add in the .pro file of the OCI (if not, I had an error when I compil it) but when I remove the add I still have this error



  • I finaly succeed the compilation... by do some modification of Qt files since 30 days.



  • @Slane hello,I have the same question,how did you modify the .pro?
    Thank you very much!!



  • I made several modifications ... but i think the properly modifications are

    In : QtSrc\qtbase\mkspecs\win32-g++\qmake.conf add

    QMAKE_LFLAGS += -static -static-libgcc
    QMAKE_CFLAGS_RELEASE -= -O2
    QMAKE_CFLAGS_RELEASE += -Os -momit-leaf-frame-pointer
    DEFINES += QT_STATIC_BUILD
    

    In : QtSrc\qtbase\src\plugins\sqldrivers\oci\oci.pro add

    QMAKE_LFLAGS += oracle_home\oci\lib\msvc\oci.lib
    QMAKE_LFLAGS += oracle_home\oci\lib\msvc\ociw32.lib
    QMAKE_LFLAGS += oracle_home\oci\lib\msvc\oraocci11.lib
    LIBS += -Loracle_home\oci\lib\msvc -loci -lociw32 -loraocci11
    INCLUDEPATH += oracle_home\oci\include
    

    cmd

    -static -debug-and-release -platform win32-g++ -prefix QtPath\Static -I C:\\OpenSSL-Win32\\include -L C:\\OpenSSL-Win32\\lib -opensource -confirm-license -c++std c++14 -nomake examples -skip qtdoc -skip wayland -skip purchasing -skip serialbus -skip qtserialport -skip script -skip scxml -skip speech -skip location -no-opengl -no-angle -qt-zlib -qt-pcre -qt-libpng -no-libjpeg -qt-freetype -sql-oci -I oracle_home\oci\include -L oracle_home\oci\lib\msvc
    

    try it. the other modifications do not matter



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