Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. QSqlDatabase: QTDS driver not loaded
QtWS25 Last Chance

QSqlDatabase: QTDS driver not loaded

Scheduled Pinned Locked Moved Qt Creator and other tools
2 Posts 1 Posters 985 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.
  • G Offline
    G Offline
    guardian
    wrote on last edited by
    #1

    I have a program which uses QTDS driver.

    in development environment everything works fine. in production i have both the TDS plugin and sybdb available with appropriate rights.

    rwxr-xr-x 1 foxprd foxprd 47880 Jan 29 17:33 libqsqltds.so

    rwxr-xr-x 1 foxprd foxprd 472579 Jan 29 17:33 libsybdb.so*

    they are both inside a directory which has been added to the LD_LIBRARY_PATH

    and yet i got

    @QSqlDatabase: QTDS driver not loaded@

    EDIT
    I aslo can tell that:

    @app.libraryPaths()@

    points to a directory in which there is an sqldrivers/ directory containing all the libs
    If i rename this direcotry in dev I get the same error, if I put it back it works again.

    MyappDir/sqldrivers/libqsqltds.so
    MyappDir/sqldrivers/libsybdb.so
    MyappDir/sqldrivers/libsybdb.so.5

    In dev it works if and only if this directory is here. In Prod it does not work in either case. While "MyappDir/" is always listed in the

    @app.libraryPaths()@

    1 Reply Last reply
    0
    • G Offline
      G Offline
      guardian
      wrote on last edited by
      #2

      self answer:

      When a linux app loads it need to be able to access all the libXXX.so it needs. "ld" will look for them in any directory declared in the "LD_LIBRARY_PATH" variable

      However Qt seems to load its plugins dynamically from some paths which can be found there:

      @QCoreApplication app(argc,argv);
      qDebug() << app.libraryPaths();@

      which printed

      @("/my/App/Path","/Qt/Dir/Path" )@

      And from one of this path it should load the plugins. So if in qtDir you have

      @/Qt/Dir/Path/plugins/sqldrivers/libqsqltds.so@

      You want to make sure to deploy something like:

      @/my/App/Path/sqldrivers/libqsqltds.so@

      this worked fine because the app path is always in "app.libraryPaths()". However, where things get complicated it that libqsqltds.so requires "libsybdb.so.5" to work properly. Which I knew so there also was a

      @/my/App/Path/sqldrivers/libsybdb.so.5 @

      which was wrong because Qt loads dynamically libqsqltds.so but not its dependency, which it seems ld expects to find the usual way ( e.g. in the LD_LIBRARY_PATH )

      The fact is that in my dev/integration environments I had libsybdb.so.5 in my path, but not in my production environment.

      So whatever Qt plugins you need make sure to copy the plugin directory ( with only the .so inside ) to your production environment. And Also make sure that performing:

      @ldd /my/App/Path/sqldrivers/libsybdb.so.5@

      will not print any "not found" as these dependency will not appear with:

      @ldd /my/App/Path/myAppBin@

      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