
#7388: CAPI doesn't work with ghci -------------------------------------+------------------------------------- Reporter: igloo | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: GHCi | Version: 7.6.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: T4012 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by hvr): Replying to [comment:10 bgamari]:
Can someone clarify what "CAPI" means in this context?
Something like {{{#!hs {-# LANGUAGE CApiFFI #-} import Foreign.C foreign import capi "stdio.h printf" printfb :: CString -> CInt -> IO () }}} There was a minor improvement in the error-message since 7.10 however: With 7.10 you get the somewhat cryptic message: {{{ [1 of 1] Compiling T4012_B ( T4012_B.hs, interpreted ) ByteCodeLink: can't find label During interactive linking, GHCi couldn't find the following symbol: ghczuwrapperZC0ZCmainZCT4012zuBZCprintf This may be due to you not asking GHCi to load extra object files, archives or DLLs needed by your current session. Restart GHCi, specifying the missing library using the -L/path/to/object/dir and -lmissinglibname flags, or simply by naming the relevant files on the GHCi command line. Alternatively, this link failure might indicate a bug in GHCi. If you suspect the latter, please send a bug report to: glasgow-haskell-bugs@haskell.org }}} whereas with GHC 8.0 you get {{{ [1 of 1] Compiling T4012_B ( T4012_B.hs, interpreted ) Error: bytecode compiler can't handle some foreign calling conventions Workaround: use -fobject-code, or compile this module to .o separately. }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/7388#comment:11 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler