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 Update on Monday, May 27th 2025

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.4k 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.
  • T Offline
    T Offline
    taalas
    wrote on 13 Aug 2018, 09:04 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 13 Aug 2018, 09:24 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
      • S Offline
        S Offline
        SGaist
        Lifetime Qt Champion
        wrote on 13 Aug 2018, 21:48 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 14 Aug 2018, 06:16 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.

          S 1 Reply Last reply 14 Aug 2018, 06:57
          0
          • T taalas
            14 Aug 2018, 06:16

            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.

            S Offline
            S Offline
            SGaist
            Lifetime Qt Champion
            wrote on 14 Aug 2018, 06:57 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

            1/5

            13 Aug 2018, 09:04

            • Login

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