Qt loads plugins of release version on a debug build - Mac only



  • Hi there,

    We have an application built with Qt but doesn't have Qt bin(s) put in the application bin folder in our development build, instead we set the location of Qt bin(s) to the PATH of the application so for it to find Qt modules.

    The problem with this is that Qt is not able to find and load the plugins. We followed instructions in this "page":http://doc.qt.nokia.com/4.5/deployment-windows.html and called QApplication::addLibraryPath() to set the folder of /plugins in. It works well on Windows.

    However, on Mac, Qt gets to the plugins folder and load releases version of the plugins for the debug build, and causes a crash later on.

    Does this sound like a known issue?



  • Maybe you should set DYLD_IMAGE_SUFFIX to -debug:

    do a
    @export DYLD_IMAGE_SUFFIX=_debug@
    for your bash or put it to the execution environment in Creator.

    If you're on snow leo you should also follow the advice on "this page":http://developer.qt.nokia.com/wiki/MacOSXTroubleshooting too.

    HTH,
    Volker



  • Hi Volker,

    Thanks for the reply.

    The situation is that, our application, in debug mode, links against debug versions of Qt framework. When the application starts, it loads the debug versions of Qt framework correctly.

    Problem happens when Qt tries to load the plugins: Qt loads the release version of the plugins while the running Qt framework is debug version.

    My confusion is that, is this something Qt is supposed to do, or is there anything I'm missing to have it load the debug version plugins correctly?



  • Hi ducktail,

    this is definitely not the right behaviour.

    You mentioned that you use QApplication::addLibraryPath() to add the library path. That could be the problem. That adds your plugin dir to the search path, but the default search path of Qt is still active and that could cause the system to load the release plugins.

    I'd suggest you try QApplication::setLibraryPaths() or QApplication::removeLibraryPath() to get rid of the system path.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.