简体   繁体   中英

Static linking wxHaskell on Mac OS X

I want to distribute a wxHaskell application on Mac OS X. How do I go about creating a Mac OS X app which can be used standalone without the user having to install any extra libraries?

I noticed the cabal-macosx project which makes .app bundles for Mac OS X. When I built the example wxHello application, the app bundle worked fine on my machine (after adding extra-lib-dirs: /usr/lib to the .cabal file). But when I tried it on another machine, I got the error: Dyld Error Message: Library not loaded: /Users/binil/.cabal/lib/wxc-0.90.0.3/ghc-7.0.4/libwxc.dylib .

You can place the required dylibs in the Contents/Resources folder within your app bundle, as that is part of the search path for dylibs. You can automate this using the project's copy files build phase.

Technically (though this does not always work for all dylibs), you should be able to pull it off "correctly" by converting the dylib to a Framework, then linking against it in your XCode project. There is a conversion script available [note: download].

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM