Go Back   The macosxhints Forums > OS X Help Requests > UNIX - General



Reply
 
Thread Tools Rating: Thread Rating: 3 votes, 5.00 average. Display Modes
Old 04-11-2012, 05:47 PM   #1
Highwind
Prospect
 
Join Date: Mar 2012
Posts: 4
static binary trying to find libpng?

Hi,

I build a static binary gui (using wxwidgets etc.).
otool -L shows nothing but if I run it on a fresh mac (same version 10.6.8) it prints:

dyld: Library not loaded: /usr/local/lib/libpng14.14.dylib

Referenced from: /Users/noname/Downloads/mygui.app/Contents/MacOS/mygui
Reason: image not found

Trace/BPT trap

So why is it looking for libpng if otool does not show a dependency?

Thanks
Highwind is offline   Reply With Quote
Old 04-11-2012, 10:34 PM   #2
dmacks
All Star
 
Join Date: Dec 2004
Posts: 678
otool -L /Users/noname/Downloads/mygui.app/Contents/MacOS/mygui

has nothing?
dmacks is offline   Reply With Quote
Old 04-12-2012, 01:42 PM   #3
Highwind
Prospect
 
Join Date: Mar 2012
Posts: 4
no, nothing
Highwind is offline   Reply With Quote
Old 04-12-2012, 03:10 PM   #4
Highwind
Prospect
 
Join Date: Mar 2012
Posts: 4
ha, the reason was the binary was packed with upx.
Running otool on the unpacked version shows all kinds of dependencies (including the libpng).
So from here I can probably figure it out.
Is it better to link statically to libpng or is there a dynamic library installed by default (maybe in a different location) that should better be used? there is other dynamic stuff like libcrypto, libSystem, libexpat, libz, libiconv.2, libstdc++.6, libobjc.A Will they be available on a fresh user system?

Thanks
Highwind is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT -5. The time now is 12:31 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.