[Haskell-cafe] include modules in DLL? "undefined reference"

Gerold Meisinger gerold.meisinger at gmail.com
Mon Dec 6 21:32:27 CET 2010


Hello!

I'm trying to compile a Windows DLL and need to include an additional module
(specifically FRP.Yampa).
I was successful with a Hello World type of DLL but when I use Yampa I get:

$ ghc -shared -o hs.dll DLLTest.o DLLTest_stub.o StartEnd.o
 Creating library file: hs.dll.a
 DLLTest.o:fake:(.text+0x46): undefined reference to
`Yampazm0zi9zi2zi3_FRPziYamp
a_integral_closure'
 DLLTest.o:fake:(.text+0x4d): undefined reference to
`Yampazm0zi9zi2zi3_FRPziYamp
aziVectorSpace_zdfVectorSpaceDoubleDouble_closure'
 DLLTest.o:fake:(.text+0x194): undefined reference to
`Yampazm0zi9zi2zi3_FRPziYam
pa_embed_closure'
 DLLTest.o:fake:(.text+0x381): undefined reference to
`__stginit_Yampazm0zi9zi2zi
3_FRPziYampa_'
 DLLTest.o:fake:(.data+0x0): undefined reference to
`Yampazm0zi9zi2zi3_FRPziYampa
_integral_closure'
 DLLTest.o:fake:(.data+0x4): undefined reference to
`Yampazm0zi9zi2zi3_FRPziYampa
ziVectorSpace_zdfVectorSpaceDoubleDouble_closure'
 DLLTest.o:fake:(.data+0x38): undefined reference to
`Yampazm0zi9zi2zi3_FRPziYamp
a_embed_closure'
 collect2: ld returned 1 exit status

How can I define the references of Yampa in the DLL?


I also tried to reinstall Yampa shared with:
$ cabal install --reinstall --enable-shared yampa
     Could not find module `Data.IORef':
       Perhaps you haven't installed the "dyn" libraries for package
`base-3.0.3.
 2'?
       Use -v to see a list of the files searched for.

$ cabal install --reinstall --enable-shared base # :)
 Resolving dependencies...
 cabal: internal error: impossible

----

(StartEnd is taken from:
http://www.haskell.org/ghc//docs/latest/html/users_guide/win32-dlls.html )

DLLTest.hs:
 {-# LANGUAGE ForeignFunctionInterface, Arrows #-}

 module DLLTest

 embeddedSF :: Double -> Double -> Double -> IO Double
 embeddedSF v0 v1 v2 = return . last $ embed integral (v0, [(1.0, Just v1),
(1.0, Just v2)])

 foreign export ccall embeddedSF :: Double -> Double -> Double -> IO Double
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20101206/b13c3c24/attachment-0001.htm>


More information about the Haskell-Cafe mailing list