dlopen on Library Works on OSX 10.5 and 10.6 but not 10.7

Do you have a typical platform dependent issue you're battling with ? Ask it here. Make sure you mention your platform, compiler, and wxWidgets version.
Post Reply
Xangis
Earned some good credits
Earned some good credits
Posts: 122
Joined: Fri Apr 14, 2006 9:49 pm
Location: Beaverton, OR
Contact:

dlopen on Library Works on OSX 10.5 and 10.6 but not 10.7

Post by Xangis » Thu Nov 03, 2011 5:51 pm

I have a dynamic library called screens.so that contains my wxWidgets dialogs. It works great on Linux, OSX 10.5 Leopard, and OSX 10.6 Snow Leopard.

On OSX 10.7 Lion it fails to find the wx libraries when opening my screens with dlopen:

ERROR: Unable to open screens.so: dlopen(screens.so, 2): Library not loaded: /usr/lib/libwx_macud-2.8.0.dylib
Referenced from: <app directory>/screens.so
Reason: image not found

It's currently built against the wx libs that ship with 10.5. Is it possible to make the same app build work on all 3 versions of OSX? Any setting I can change?

I've been trying to avoid building wx from scratch and static linking because it makes for a larger executable and is a bit of a chore to get right, but I can if I have to.
WinVista/7: VC++ .Net 2010 / Ubuntu 11.04: gcc4.4.3 [2.8.12 on all]

Xangis
Earned some good credits
Earned some good credits
Posts: 122
Joined: Fri Apr 14, 2006 9:49 pm
Location: Beaverton, OR
Contact:

Re: dlopen on Library Works on OSX 10.5 and 10.6 but not 10.

Post by Xangis » Thu Dec 15, 2011 6:51 pm

Simple, stupid solution that I should have noticed to begin with:

OSX 10.7 does not ship with wxWidgets libraries, so it couldn't find them.
WinVista/7: VC++ .Net 2010 / Ubuntu 11.04: gcc4.4.3 [2.8.12 on all]

Post Reply