<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<p>
</p>
<div class="moz-text-html" lang="x-unicode"> You could provide a
wrapper script around ghc to pass -dynamic automatically.<br>
Or when installing append alias ghc="ghc -dynamic" to their
bashrc.<br>
Not elegant but it's probably easier than any other solution.<br>
<br>
<div class="moz-cite-prefix">On 06/24/2017 08:00 AM, <a
class="moz-txt-link-abbreviated"
href="mailto:haskell-cafe-request@haskell.org">haskell-cafe-request@haskell.org</a>
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:mailman.5.1498305601.18095.haskell-cafe@haskell.org">
<pre wrap="">Message: 1
Date: Fri, 23 Jun 2017 11:31:37 -0400
From: Ryan Trinkle <a class="moz-txt-link-rfc2396E" href="mailto:ryan.trinkle@gmail.com"><ryan.trinkle@gmail.com></a>
To: Haskell Cafe <a class="moz-txt-link-rfc2396E" href="mailto:haskell-cafe@haskell.org"><haskell-cafe@haskell.org></a>
Subject: [Haskell-cafe] Dynamically linking frameworks on macOS
Message-ID:
<a class="moz-txt-link-rfc2396E" href="mailto:CAHNEpix8NeMNo=ur3FX_Hs4Li8RTx4t0KT7aUutVGcN4_J5XVQ@mail.gmail.com"><CAHNEpix8NeMNo=ur3FX_Hs4Li8RTx4t0KT7aUutVGcN4_J5XVQ@mail.gmail.com></a>
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
"<span class="moz-txt-underscore"><span class="moz-txt-tag">_</span>OBJC_CLASS<span class="moz-txt-tag">_</span></span>$_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] <a class="moz-txt-link-freetext" href="https://developer.apple.com/library/content/qa/qa1118/_index.html">https://developer.apple.com/library/content/qa/qa1118/_index.html</a></pre>
</blockquote>
<br>
</div>
</body>
</html>