RE: DLLs and shared libraries

On 14 June 2004 03:03, Andrei de A. Formiga wrote:
I need to generate DLLs (in Windows) and shared libraries (in unix environments) that expose some Haskell functions (directly or through a C stub). My first option is having ghc generate the libs directly with the foreign export functions. But, searching through the documentation, FAQ, web and some part of the list archives, I didn't find any mention about how to do this. The manual mentions the capability to create DLLs in windows but as not working and unsupported. If this is possible to do in all or most platforms supported by ghc, I would be glad to know how.
You can create a DLL of Haskell code on Windows, but only of a complete self-contained library (ie. you can't split your Haskell library into several DLLs and link them together at runtime). On Unix, shared libraries are more difficult. It might be possible to make a single .so of a Haskell library, but I'm not sure. Alternatively you can use Don Stewart's hs-plugin package (announced here recently). Cheers, Simon

--- Simon Marlow
On 14 June 2004 03:03, Andrei de A. Formiga wrote:
You can create a DLL of Haskell code on Windows, but only of a complete self-contained library (ie. you can't split your Haskell library into several DLLs and link them together at runtime).
That's good. It solves my problems on Windows.
On Unix, shared libraries are more difficult. It might be possible to make a single .so of a Haskell library, but I'm not sure. Alternatively you can use Don Stewart's hs-plugin package (announced here recently).
hs-plugin seems like a nice package, but I actually need a shared library to interface with the JVM through JNI. I'll try to get this working. Thanks for your answers. --- []s, Andrei Formiga __________________________________ Do you Yahoo!? Read only the mail you want - Yahoo! Mail SpamGuard. http://promotions.yahoo.com/new_mail
participants (2)
-
Andrei de A. Formiga
-
Simon Marlow