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. Using sqlite with a static build of Qt 5.9.4 in MSVC2017
Forum Updated to NodeBB v4.3 + New Features

Using sqlite with a static build of Qt 5.9.4 in MSVC2017

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
5 Posts 2 Posters 1.5k Views 2 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.
  • T Offline
    T Offline
    taalas
    wrote on last edited by
    #1

    Hi,

    I am currently in the process of migrating a legacy application to Qt 5.9.4 which uses SQlite.

    I have compiled a static version of Qt 5.9.4 with the new "--sql-sqlite" option, which generated a qsqlite.lib plugin in sqldrivers.

    If I link this library the application produces an error (QSQLITE driver not loaded). If I insert

    Q_IMPORT_PLUGIN(qsqlite)
    

    into my application I get a linker error:

    LNK2001	Unresolved symbol "struct QStaticPlugin const __cdecl qt_static_plugin_qsqlite(void)" (?qt_static_plugin_qsqlite@@YA?BUQStaticPlugin@@XZ)".
    
    

    Is there anything else I need to be doing? We are using the Qt Visual Studio Tools (so no qmake .pro file).

    Is it not possible to integrate sqlite in to static core directly (as was previously possible wit "--qt-sqlite" iirc)?

    1 Reply Last reply
    0
    • T Offline
      T Offline
      taalas
      wrote on last edited by
      #2

      Ok, I think the correct import is:

      Q_IMPORT_PLUGIN(QSQLiteDriverPlugin)
      

      Is this documented somewhere (to make sure)?

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

        Hi and welcome to devnet,

        It's explained in the Plugins Howto in Qt's documentation.

        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
        • T Offline
          T Offline
          taalas
          wrote on last edited by
          #4

          Hi, thanks for your reply.

          The article you linked does cover the use of static plugins but only in a qmake-environment (which I don't use). Also I could not find any reference to the actual plugin name (QSQLiteDriverPlugin) yet.

          SGaistS 1 Reply Last reply
          0
          • T taalas

            Hi, thanks for your reply.

            The article you linked does cover the use of static plugins but only in a qmake-environment (which I don't use). Also I could not find any reference to the actual plugin name (QSQLiteDriverPlugin) yet.

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

            What you can do is create a project using qmake that uses everything you need for your other application then inspect the generated visual studio project for the informations you need.

            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