[email protected]
[Top] [All Lists]

Re: [Haskell-cafe] Compiling a shared library on MacOS X

Subject: Re: [Haskell-cafe] Compiling a shared library on MacOS X
From: Ivan Miljenovic
Date: Mon, 4 Jan 2010 09:36:40 +1000
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
work).

2010/1/4 Jean-Denis Koeck <[email protected]>:
> Hello,
> 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
> Qt),
> 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
> [email protected]
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
>



-- 
Ivan Lazar Miljenovic
[email protected]
IvanMiljenovic.wordpress.com
Joan Crawford  - "I, Joan Crawford, I believe in the dollar.
Everything I earn, I spend." -
http://www.brainyquote.com/quotes/authors/j/joan_crawford.html
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

<Prev in Thread] Current Thread [Next in Thread>