Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 1

Qt-interest Archive, March 2008
Re: Mac OS Library paths


Message 1 in thread

Not sure how this helps. It all links fine, just can't find it at runtime.

> .../debug% otool -L myapp.app
> otool: can't map file: myapp.app ((os/kern) invalid argument)

myapp.app is of course a MacOSX application (directory)

If I dig into the app directory:

> myapp.app/Contents/MacOS% otool -L myapp
> myapp:
>         
> /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
> (compatibility version 150.0.0, current version 368.32.0)
>         /Library/Frameworks/iODBC.framework/Versions/3.52/iODBC (compatibility
> version 1.0.0, current version 3.52.4)
>         /Library/Frameworks/iODBCinst.framework/Versions/3.52/iODBCinst
> (compatibility version 1.0.0, current version 3.52.4)
>         libqjpeg_debug.dylib (compatibility version 0.0.0, current version
> 0.0.0)
>         libqgif_debug.dylib (compatibility version 0.0.0, current version
> 0.0.0)
>         libqmng_debug.dylib (compatibility version 0.0.0, current version
> 0.0.0)
>         libqtiff_debug.dylib (compatibility version 0.0.0, current version
> 0.0.0)
>         libqsvg_debug.dylib (compatibility version 0.0.0, current version
> 0.0.0)
>         /usr/local/Trolltech/Qt-4.3.4/lib/libQtSvg_debug.4.dylib
> (compatibility version 4.3.0, current version 4.3.4)
>         /usr/local/Trolltech/Qt-4.3.4/lib/libQtXml_debug.4.dylib
> (compatibility version 4.3.0, current version 4.3.4)
>         /usr/local/Trolltech/Qt-4.3.4/lib/libQtGui_debug.4.dylib
> (compatibility version 4.3.0, current version 4.3.4)
>         /System/Library/Frameworks/Carbon.framework/Versions/A/Carbon
> (compatibility version 2.0.0, current version 128.0.0)
>         /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit
> (compatibility version 45.0.0, current version 824.44.0)
>         /usr/local/Trolltech/Qt-4.3.4/lib/libQtNetwork_debug.4.dylib
> (compatibility version 4.3.0, current version 4.3.4)
>         /usr/local/Trolltech/Qt-4.3.4/lib/libQtCore_debug.4.dylib
> (compatibility version 4.3.0, current version 4.3.4)
>         /usr/lib/libz.1.dylib (compatibility version 1.0.0, current version
> 1.2.3)
>         /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current
> version 88.1.10)
>         
> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Applicatio
> nServices (compatibility version 1.0.0, current version 22.0.0)
>         /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current
> version 7.4.0)
>         /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current
> version 1.0.0)

And for the Qt plugin:
> 
> Qt-4.3.4/plugins/imageformats% otool -L libqjpeg_debug.dylib
> libqjpeg_debug.dylib:
>         libqjpeg_debug.dylib (compatibility version 0.0.0, current version
> 0.0.0)
>         /usr/local/Trolltech/Qt-4.3.4/lib/libQtGui_debug.4.dylib
> (compatibility version 4.3.0, current version 4.3.4)
>         /System/Library/Frameworks/Carbon.framework/Versions/A/Carbon
> (compatibility version 2.0.0, current version 128.0.0)
>         /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit
> (compatibility version 45.0.0, current version 824.44.0)
>         /usr/local/Trolltech/Qt-4.3.4/lib/libQtCore_debug.4.dylib
> (compatibility version 4.3.0, current version 4.3.4)
>         /usr/lib/libz.1.dylib (compatibility version 1.0.0, current version
> 1.2.3)
>         /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current
> version 88.1.10)
>         
> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Applicatio
> nServices (compatibility version 1.0.0, current version 22.0.0)
>         /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current
> version 7.4.0)
>         /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current
> version 1.0.0)

Obviously, the application does not hard-code the paths for plugins, but how
do I tell all the Qt Applications where to look?

Keith
**Please do not reply to me, reply to the list.**

On 02-29-2008 9:32 AM, "Mike Jackson" wrote:

> On 2008-02-28 19:36:22 -0500, Keith Esau <keith.esau@xxxxxxx> said:
> 
>>> This message is in MIME format. Since your mail reader does not understand
>> this format, some or all of this message may not be legible.
>> 
>> 
>> I recently changed my build to use shared libraries instead of static
>> libraries. Everything builds and runs fine on Windows, but the Mac can't
>> find the Qt plugins/imageformat files (fails loading, see error below). I
>> tried adding $QTDIR/plugins to DYLD_LIBRARY_PATH, but that does not help.
>> 
>> How do I tell the Mac where to look for Qt Plugins (regardless of which Qt
>> application is running)?
>> 
>> Keith
>> **Please do not reply to me, reply to the list.**
>> 
>>> dyld: Library not loaded: libqjpeg_debug.dylib
>>> Referenced from: /.../dpsheet
>>> Reason: image not found
>>> Trace/BPT trap
>> 
>> 
> 
> 
> I don't think the "install_name" is correct for either the plugin or
> your application. The "install_name" should be:
>  Just the name of the plugin
> OR
> the Absolute path to the plugin
> OR
> something like @executable_path/../plugins
> 
> Can you post the results of "otool -L" on both your plugin and your
> application?
> 
> Mike Jackson


Message 2 in thread

Well, I found  the problem. Apparently, QMAKE_QT_DLL is not defined on the
Mac when shared libraries are built, so I had to manually remove the static
library additions in the .pro file.

On 02-28-2008 6:36 PM, "Keith Esau" wrote:

> I recently changed my build to use shared libraries instead of static
> libraries. Everything builds and runs fine on Windows, but the Mac can't find
> the Qt plugins/imageformat files (fails loading, see error below). I tried
> adding $QTDIR/plugins to DYLD_LIBRARY_PATH, but that does not help.
> 
> How do I tell the Mac where to look for Qt Plugins (regardless of which Qt
> application is running)?
> 
> Keith
> **Please do not reply to me, reply to the list.**
> 
>> dyld: Library not loaded: libqjpeg_debug.dylib
>>     Referenced from: /.../dpsheet
>>     Reason: image not found
>> Trace/BPT trap
> 


Keith
**Please do not reply to me, reply to the list.**