[solved] Re: [Haskell-cafe] c2hs and cabal?

Magnus Therning magnus at therning.org
Wed Nov 29 06:26:47 EST 2006


On Wed, Nov 29, 2006 at 03:38:24 +0000, Duncan Coutts wrote:
>On Tue, 2006-11-28 at 17:24 +0000, Magnus Therning wrote:
>> On Tue, Nov 28, 2006 at 12:00:50 +0000, Magnus Therning wrote:
>> [..]
>> >Can't really see anything obviously bogus about the following:
>> >
>> >  % cat Foo.chs
>> >  module Foo where
>> >
>> >  #include "foo.h"
>> >
>> >  fooOne i = {# call foo1 #} i
>> 
>> I solved my problem, but thought I'd send a mail to the list for anyone
>> who's struggling as much as me (if that's even possible).
>> 
>> The problem was that GHC requires a commandline argument telling it to
>> deal with FFI.  Including the following in Foo.chs resulted in
>> successful compilation:
>> 
>>  {-# OPTIONS_GHC -fffi #-}
>
>Or the simpler way is to include in your .cabal file:
>
>extensions: ForeignFunctionInterface
>
>That then applies to every module in the lib and has the advantage of
>being portable between compilers.

Ah, good point.

Now, where could I have turned to find this out myself?  I can't find it
in the Cabal User's Guide[1].

/M

[1]: http://www.haskell.org/cabal/release/latest/doc/users-guide/

-- 
Magnus Therning                             (OpenPGP: 0xAB4DFBA4)
magnus at therning.org             Jabber: magnus.therning at gmail.com
http://therning.org/magnus

Software is not manufactured, it is something you write and publish.
Keep Europe free from software patents, we do not want censorship
by patent law on written works.

I have steadily endeavored to keep my mind free, so as to give up any
hypothesis, however much beloved -- and I cannot resist forming one
on every subject -- as soon as facts are shown to be opposed to it.
     -- Charles Darwin (1809-1882)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://www.haskell.org/pipermail/haskell-cafe/attachments/20061129/005066aa/attachment.bin


More information about the Haskell-Cafe mailing list