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. Mysql plugin not loaded when running in debug mode
Forum Updated to NodeBB v4.3 + New Features

Mysql plugin not loaded when running in debug mode

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 2.2k 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.
  • J Offline
    J Offline
    jyavenard
    wrote on last edited by
    #1

    Hi there.

    Using QtSDK 1.2.1 on a mac.

    I'm trying to identify an issue with my application, and as such trying to use Qt debug libraries.
    Following the documentation there:

    http://qt-project.org/doc/qt-4.8/debug.html
    I set export DYLD_IMAGE_SUFFIX=_debug

    When doing so, I can see that the Qt debut libraries are properly loaded.
    However, it can't find the mysql plugins.

    mysql plugin is installed, for both standard and debug:
    jyaimac:plugins jyavenard$ ls -l sqldrivers/
    total 4976
    -rwxr-xr-x 1 jyavenard staff 646992 20 Apr 13:39 libqsqlite.dylib
    -rwxr-xr-x 1 jyavenard staff 958048 20 Apr 13:39 libqsqlite_debug.dylib
    -rwxr-xr-x 1 jyavenard staff 93376 20 Apr 15:02 libqsqlmysql.dylib
    -rwxr-xr-x 1 jyavenard staff 187752 20 Apr 15:01 libqsqlmysql_debug.dylib
    -rwxr-xr-x 1 jyavenard staff 169032 20 Apr 13:39 libqsqlodbc.dylib
    -rwxr-xr-x 1 jyavenard staff 210144 20 Apr 13:39 libqsqlodbc_debug.dylib
    -rwxr-xr-x 1 jyavenard staff 111176 20 Apr 13:39 libqsqlpsql.dylib
    -rwxr-xr-x 1 jyavenard staff 159088 20 Apr 13:39 libqsqlpsql_debug.dylib

    If I unset DYLD_IMAGE_SUFFIX, then everything works fine...

    What is the proper way of not only running debug version of Qt and still have access to plugins ?

    Thanks in advance.

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

      I would suspect that the dynamic linker tries to load libmysqlclient_debug.dylib - i.e. the mysql library itself with the respective suffix. Try to find the installation directory of your mysql libs:

      @

      on the shell issue

      locate libmysqlclient.dylib
      @

      and then setup some symlinks:

      @
      cd /usr/local/mysql/lib
      ln -s libmysqlclient.dylib libmysqlclient_debug.dylib
      @

      You might need to add the respective symlinks for the versioned file names too.

      http://www.catb.org/~esr/faqs/smart-questions.html

      1 Reply Last reply
      0
      • J Offline
        J Offline
        jyavenard
        wrote on last edited by
        #3

        Actuelly, i had already created the symlinks as I too thought it was the issue.

        However, activating linker logs showed that it was not even loading the original plugin to start with.

        I then looked at what QStringList QCoreApplication::libraryPaths would return, and the value was different to when running in non-debug mode.
        In non-debug it points to the Qt system plugin directory (where the MySQL plugin was copied) but when running in debug mode it is set to the working dir.

        So I simply created a link in my working directory to the system Qt lib. And it's now working.

        A tad confusing...
        Since I've found why it's crashing, and the bug is in qt unfortunately.

        Thanks for the help.

        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