On Dec 23, 2009, at 9:33 AM, Daniell Freed wrote:

> I've notice on OS X in the Perl library directory auto/Wx/ that there is a 
> wxPerl.app.  What is the purpose of this?  
> 
> I ask because I'm struggling to get the perlwrapper to work correctly on OS X 
> Snow Leopard.  I can run my project from the command line, and I can even 
> build the xcode project to create an application bundle.  What is strange is 
> that when I open the application bundle via the GUI it errors out with the 
> error:
> 
> Can't load 
> '/Users/dfreed/sourcecode/ssystems/alchemist/trunk/OSX/build/Deployment/Alchemist.app/Contents/Resources/Perl-Libraries/auto/Wx/Wx.bundle'
>  for module Wx: 
> dlopen(/Users/dfreed/sourcecode/ssystems/alchemist/trunk/OSX/build/Deployment/Alchemist.app/Contents/Resources/Perl-Libraries/auto/Wx/Wx.bundle,
>  1): Symbol not found: __ZN19wxTopLevelWindowMac7DestroyEv
> 
> If I use the command line to run:  open Alchemist.app  It will work fine.  
> 
> So, I was wondering if there was some way to use the wxPerl.app bundle to run 
> my application, instead of trying to continue to try to use the perlwrapper 
> xcode project.
> 

The most likely reason that it runs from the command line and not from your app 
bundle is that the app depends on an environment variable that's set in your 
shell. (DYLD_LIBRARY_PATH would be a good candidate, given that it's a link 
error.) 

Apps started by launchd (either from being double-clicked in Finder or with 
open(1)) don't get your environment. While you can fix this for yourself by 
adding the necessary environment variables to ~/.MacOS/environment.plist, 
that's not a distributable solution. Instead, have the primary perl module (the 
one that's pointed to by Info.plist) set up its environment before using or 
requiring any modules that aren't provided by Apple.

Regards,
John Ralls

Reply via email to