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 Updated to NodeBB v4.3 + New Features

Problem with loading SQL Drivers

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 1.3k Views 1 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.
  • _ Offline
    _ Offline
    __meow__
    wrote on 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
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on 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 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
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on 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

          • Login

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