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. [SOLVED]Connecting to database in Static build

[SOLVED]Connecting to database in Static build

Scheduled Pinned Locked Moved General and Desktop
6 Posts 3 Posters 1.9k 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.
  • M Offline
    M Offline
    mbnoimi
    wrote on last edited by
    #1

    Hello,

    As I know static build preventing using database plug-in drivers.
    Is there any way to make my application connecting to the database with static build?

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

      Hi,

      Have a look at the "plugin":http://qt-project.org/doc/qt-4.8/plugins-howto.html#static-plugins 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
      • M Offline
        M Offline
        mbnoimi
        wrote on last edited by
        #3

        [quote author="SGaist" date="1366196645"]Hi,

        Have a look at the "plugin":http://qt-project.org/doc/qt-4.8/plugins-howto.html#static-plugins documentation[/quote]

        I added the plugins as mentioned above during configuration process:
        [code]./configure -static -developer-build -v -qt-sql-psql -qt-sql-sqlite -plugin-sql-psql -plugin-sql-sqlite -qt-zlib -qt-libpng -qt-libjpeg -qt-pcre -qt-xcb[/code]

        PS
        I'm using Qt 5.0.2

        1 Reply Last reply
        0
        • C Offline
          C Offline
          Code_ReaQtor
          wrote on last edited by
          #4

          Plugin works with "shared/dll" builds. However, if you built Qt from source in "static" mode, you may still connect to a database - database plugins will be added to QtSql.lib/QtSqld.lib (I think).

          There is also another option, use "QSqlDatabase::registerSqlDriver":http://qt-project.org/doc/qt-4.8/qsqldatabase.html#registerSqlDriver if you have a custom Sql Driver. I wrote a "blog":http://qtsimplify.blogspot.com/ on that thing 2 days ago if you need a reference.

          Please visit my open-source projects at https://github.com/Code-ReaQtor.

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

            You can find a similar document for Qt5

            Did you update the pro file and your code to make use of the plugins 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
            • M Offline
              M Offline
              mbnoimi
              wrote on last edited by
              #6

              Sorry guys.. my mistake I forgot to add the following to my .pro file

              [code]QTPLUGIN += qsqlpsql[/code]

              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