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. Problem with loading SQL Drivers
Forum Update on Monday, May 27th 2025

Problem with loading SQL Drivers

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 1.2k 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.
  • _ Offline
    _ Offline
    __meow__
    wrote on 1 Oct 2013, 12:32 last edited by
    #1

    I build app in Mac OS X with PostgreSQL, so I used QPSQL driver.
    But when I build app for Windows I use MSSQL and QODBC driver.
    In the Settings window (https://github.com/wid0ki/Berlitz/blob/master/settings.cpp) user can set some attributes for connection. On Mac I can connect to db, and do everything that I need.
    But when we build app for Win, we see:
    QSqlDatabase: driver not loaded
    QSqlDatabase: available drivers: QSQLITE QODBC QODBC3 QPSQL QPSQL7
    Something wrong with db openning hey!
    QSqlError(-1, "Driver not loaded", "Driver not loaded")

    Also we write: QApplication::addLibraryPath("C:\Qt\5.1.1\Src\qtbase\src\plugins");
    but it doesn't help.

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 1 Oct 2013, 13:58 last edited by
      #2

      Hi,

      Do you have the plugin dll dependencies in your PATH ?

      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
      • _ Offline
        _ Offline
        __meow__
        wrote on 1 Oct 2013, 14:15 last edited by
        #3

        Hi,
        actually we build Qt with -static key. And want to get static build app without any .dll. Is it possible?
        [quote author="SGaist" date="1380635914"]Hi,

        Do you have the plugin dll dependencies in your PATH ?[/quote]

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 1 Oct 2013, 15:55 last edited by
          #4

          AFAIK it should be, but you would also need to link to the static version of your dependencies (e.g. you sql plugins)

          The plugins can be static but linked to the dynamic library of e.g. mysql.

          Also, don't forget the licensing implication of a static build

          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/4

          1 Oct 2013, 12:32

          • Login

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