[Haskell-cafe] Dynamically linking frameworks on macOS (Ryan Trinkle)

Thomas Jakway tjakway at nyu.edu
Mon Jun 26 06:26:59 UTC 2017


You could provide a wrapper script around ghc to pass -dynamic 
automatically.
Or when installing append alias ghc="ghc -dynamic" to their bashrc.
Not elegant but it's probably easier than any other solution.

On 06/24/2017 08:00 AM, haskell-cafe-request at haskell.org wrote:
> Message: 1
> Date: Fri, 23 Jun 2017 11:31:37 -0400
> From: Ryan Trinkle<ryan.trinkle at gmail.com>
> To: Haskell Cafe<haskell-cafe at haskell.org>
> Subject: [Haskell-cafe] Dynamically linking frameworks on macOS
> Message-ID:
> 	<CAHNEpix8NeMNo=ur3FX_Hs4Li8RTx4t0KT7aUutVGcN4_J5XVQ at mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> 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/20170626/65273e93/attachment.html>


More information about the Haskell-Cafe mailing list