[Haskell-cafe] Compiling a shared library on MacOS X
mwotton at gmail.com
Mon Jan 4 19:38:08 EST 2010
There's a patch for it in GHC HEAD by Stephen Blackheath and me, and
an accompanying patch for Cabal.
has the details.
On Mon, Jan 4, 2010 at 10:36 AM, Ivan Miljenovic
<ivan.miljenovic at gmail.com> wrote:
> If I recall correctly, dynamic linking/shared library support is not
> yet available for OSX, as the Industrial Haskell Group does not have
> any knowledge of OSX (but is willing to pay someone who does to do the
> 2010/1/4 Jean-Denis Koeck <jdkoeck at gmail.com>:
>> I'm using the following cabal file to build a shared library with ghc:
>> Build-Type: Simple
>> Executable libmylibrary.dll
>> If os(windows)
>> CPP-Options: -DWIN32
>> Extensions: ForeignFunctionInterface
>> Build-Depends: ...
>> Main-Is: libmylibrary.hs
>> Ghc-Options: -W --make -no-hs-main -optl-shared -optl-s -O2
>> The resulting library is called from a C++ graphical user interface (using
>> which worked great so far on Windows and Linux.
>> However, the compilation fails on MacOS X:
>> Undefined symbols:
>> "_ZCMain_main_closure", referenced from:
>> _ZCMain_main_closure$non_lazy_ptr in libHSrts.a(Main.o)
>> "___stginit_ZCMain", referenced from:
>> ___stginit_ZCMain$non_lazy_ptr in libHSrts.a(Main.o)
>> ld: symbol(s) not found
>> collect2: ld returned 1 exit status
>> I don't know much about shared libraries, even less about them on MacOS X :(
>> Any idea ?
>> Jean-Denis Koeck
>> Haskell-Cafe mailing list
>> Haskell-Cafe at haskell.org
> Ivan Lazar Miljenovic
> Ivan.Miljenovic at gmail.com
> Joan Crawford - "I, Joan Crawford, I believe in the dollar.
> Everything I earn, I spend." -
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
A UNIX signature isn't a return address, it's the ASCII equivalent of a
black velvet clown painting. It's a rectangle of carets surrounding a
quote from a literary giant of weeniedom like Heinlein or Dr. Who.
-- Chris Maeda
More information about the Haskell-Cafe