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. QT OCI driver isn't working with MSVC compiler
Forum Updated to NodeBB v4.3 + New Features

QT OCI driver isn't working with MSVC compiler

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 1 Posters 380 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.
  • R Offline
    R Offline
    Rialbat
    wrote on last edited by
    #1

    I have compiled the OCI driver for MinGW and MSVC. It works with MinGW compiler but not with MSVC. When I use MSVC compiler in my project I get the error "QOCI driver not loaded".
    Debug plugins log:

    QFactoryLoader::QFactoryLoader() checking directory path "F:/Qt/6.2.0/msvc2019_64/plugins/sqldrivers" ...
    QFactoryLoader::QFactoryLoader() looking at "F:/Qt/6.2.0/msvc2019_64/plugins/sqldrivers/qsqlite.dll"
    Found metadata in lib F:/Qt/6.2.0/msvc2019_64/plugins/sqldrivers/qsqlite.dll, metadata=
    {
        "IID": "org.qt-project.Qt.QSqlDriverFactoryInterface",
        "MetaData": {
            "Keys": [
                "QSQLITE"
            ]
        },
        "archreq": 0,
        "className": "QSQLiteDriverPlugin",
        "debug": false,
        "version": 393728
    }
    
    
    "The plugin 'F:/Qt/6.2.0/msvc2019_64/plugins/sqldrivers/qsqlite.dll' uses incompatible Qt library. (Cannot mix debug and release libraries.)" 
             not a plugin
    QFactoryLoader::QFactoryLoader() looking at "F:/Qt/6.2.0/msvc2019_64/plugins/sqldrivers/qsqlited.dll"
    Found metadata in lib F:/Qt/6.2.0/msvc2019_64/plugins/sqldrivers/qsqlited.dll, metadata=
    {
        "IID": "org.qt-project.Qt.QSqlDriverFactoryInterface",
        "MetaData": {
            "Keys": [
                "QSQLITE"
            ]
        },
        "archreq": 1,
        "className": "QSQLiteDriverPlugin",
        "debug": true,
        "version": 393728
    }
    
    
    Got keys from plugin meta data QList("QSQLITE")
    QFactoryLoader::QFactoryLoader() looking at "F:/Qt/6.2.0/msvc2019_64/plugins/sqldrivers/qsqloci.dll"
    Found metadata in lib F:/Qt/6.2.0/msvc2019_64/plugins/sqldrivers/qsqloci.dll, metadata=
    {
        "IID": "org.qt-project.Qt.QSqlDriverFactoryInterface",
        "MetaData": {
            "Keys": [
                "QOCI"
            ]
        },
        "archreq": 0,
        "className": "QOCIDriverPlugin",
        "debug": false,
        "version": 393728
    }
    
    
    "The plugin 'F:/Qt/6.2.0/msvc2019_64/plugins/sqldrivers/qsqloci.dll' uses incompatible Qt library. (Cannot mix debug and release libraries.)" 
             not a plugin
    QFactoryLoader::QFactoryLoader() looking at "F:/Qt/6.2.0/msvc2019_64/plugins/sqldrivers/qsqlodbc.dll"
    Found metadata in lib F:/Qt/6.2.0/msvc2019_64/plugins/sqldrivers/qsqlodbc.dll, metadata=
    {
        "IID": "org.qt-project.Qt.QSqlDriverFactoryInterface",
        "MetaData": {
            "Keys": [
                "QODBC"
            ]
        },
        "archreq": 0,
        "className": "QODBCDriverPlugin",
        "debug": false,
        "version": 393728
    }
    
    
    "The plugin 'F:/Qt/6.2.0/msvc2019_64/plugins/sqldrivers/qsqlodbc.dll' uses incompatible Qt library. (Cannot mix debug and release libraries.)" 
             not a plugin
    QFactoryLoader::QFactoryLoader() looking at "F:/Qt/6.2.0/msvc2019_64/plugins/sqldrivers/qsqlodbcd.dll"
    Found metadata in lib F:/Qt/6.2.0/msvc2019_64/plugins/sqldrivers/qsqlodbcd.dll, metadata=
    {
        "IID": "org.qt-project.Qt.QSqlDriverFactoryInterface",
        "MetaData": {
            "Keys": [
                "QODBC"
            ]
        },
        "archreq": 1,
        "className": "QODBCDriverPlugin",
        "debug": true,
        "version": 393728
    }
    
    
    Got keys from plugin meta data QList("QODBC")
    QFactoryLoader::QFactoryLoader() looking at "F:/Qt/6.2.0/msvc2019_64/plugins/sqldrivers/qsqlpsql.dll"
    Found metadata in lib F:/Qt/6.2.0/msvc2019_64/plugins/sqldrivers/qsqlpsql.dll, metadata=
    {
        "IID": "org.qt-project.Qt.QSqlDriverFactoryInterface",
        "MetaData": {
            "Keys": [
                "QPSQL"
            ]
        },
        "archreq": 0,
        "className": "QPSQLDriverPlugin",
        "debug": false,
        "version": 393728
    }
    
    
    "The plugin 'F:/Qt/6.2.0/msvc2019_64/plugins/sqldrivers/qsqlpsql.dll' uses incompatible Qt library. (Cannot mix debug and release libraries.)" 
             not a plugin
    QFactoryLoader::QFactoryLoader() looking at "F:/Qt/6.2.0/msvc2019_64/plugins/sqldrivers/qsqlpsqld.dll"
    Found metadata in lib F:/Qt/6.2.0/msvc2019_64/plugins/sqldrivers/qsqlpsqld.dll, metadata=
    {
        "IID": "org.qt-project.Qt.QSqlDriverFactoryInterface",
        "MetaData": {
            "Keys": [
                "QPSQL"
            ]
        },
        "archreq": 1,
        "className": "QPSQLDriverPlugin",
        "debug": true,
        "version": 393728
    }
    
    
    Got keys from plugin meta data QList("QPSQL")
    QFactoryLoader::QFactoryLoader() checking directory path "F:/labs/Diplom/build-DiplomaWork-Desktop_Qt_6_2_0_MSVC2019_64bit-Debug/debug/sqldrivers" ...
    QSqlDatabase: QOCI driver not loaded
    QSqlDatabase: available drivers: QSQLITE QODBC QPSQL
    

    QT 6.2.3 64bit
    MSVC 2019 64bit

    1 Reply Last reply
    0
    • R Offline
      R Offline
      Rialbat
      wrote on last edited by
      #3

      The problem has been fixed by using the VS Command Prompt.

      1 Reply Last reply
      0
      • R Offline
        R Offline
        Rialbat
        wrote on last edited by
        #2

        Additional information.
        The driver is compiled according to the instructions:

        qt-cmake.bat -G Ninja F:\Qt\6.2.0\Src\qtbase\src\plugins\sqldrivers -DCMAKE_INSTALL_PREFIX=F:\Qt\6.2.0\msvc2019_64 -DOracle_INCLUDE_DIR="C:\oracle\sdk\include" -DOracle_LIBRARY="C:\oracle\sdk\lib\msvc\oci.lib" cmake --build . cmake --install .
        

        Environment settings:

        PATH=C:\oracle
        ORACLE_HOME=C:\oracle
        TNS_ADMIN=C:\oracle
        ORACLE_SID=orcl
        
        1 Reply Last reply
        0
        • R Offline
          R Offline
          Rialbat
          wrote on last edited by
          #3

          The problem has been fixed by using the VS Command Prompt.

          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