| Paste number 22350: | Argh! |
| Pasted by: | ihope |
| When: | 2 years, 11 months ago |
| Share: | Tweet this! | http://paste.lisp.org/+H8U |
| Channel: | #haskell |
| Paste contents: |
{- ffitest-c.h:
int _add(int x, int y) {
return x+y;
}
ffitest-hs.hs: -}
import Foreign.C.Types
foreign import ccall "ffitest.h _add" add :: CInt -> CInt -> CInt
main = print (add 3 2)
{-
C:\ghc\ghc-6.4.1\bin>ghci -fffi "C:\Documents and Settings\foobar\Desktop\Haskel
l FFI\ffitest-hs.hs" "C:\Documents and Settings\foobar\Desktop\Haskell FFI\ffite
st-c.o"
___ ___ _
/ _ \ /\ /\/ __(_)
/ /_\// /_/ / / | | GHC Interactive, version 6.4.1, for Haskell 98.
/ /_\\/ __ / /___| | http://www.haskell.org/ghc/
\____/\/ /_/\____/|_| Type :? for help.
Loading package base-1.0 ... linking ... done.
Loading object (static) C:/Documents and Settings/foobar/Desktop/Haskell FFI/ffi
test-c.o ... : C:/Documents and Settings/foobar/Desktop/Haskell FFI/ffitest-c.o:
Not x86 PEi386
: panic! (the `impossible' happened, GHC version 6.4.1):
loadObj: failed
Please report it as a compiler bug to glasgow-haskell-bugs@haskell.org,
or http://sourceforge.net/projects/ghc/.
C:\ghc\ghc-6.4.1\bin>
-}This paste has no annotations.