[Haskell-cafe] Dynamically linking frameworks on macOS

Ryan Trinkle ryan.trinkle at gmail.com
Fri Jun 23 15:31:37 UTC 2017


Hi everyone,

I'm trying to ensure that beginner-level code that uses reflex-dom can be
built by simply calling 'ghc myFile.hs', provided that all the necessary
libraries are available in ghc-pkg.  This works on linux, but on macOS,
it's currently necessary for the user to add '-dynamic' to the command
line.  In particular, without -dynamic, the linker fails to find
"_OBJC_CLASS_$_NSURL", which is a symbol in the Foundation system
framework.  Apple doesn't support (and strongly discourages) statically
linked executables[1], so it's not terribly surprising that this doesn't
work.

Is there anything I can do to avoid the need for -dynamic here?


Thanks,
Ryan

[1] https://developer.apple.com/library/content/qa/qa1118/_index.html
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20170623/cbfb513a/attachment.html>


More information about the Haskell-Cafe mailing list