Repeated #include in ghci broken?

Ian Lynagh igloo at earth.li
Tue Mar 10 22:15:35 EDT 2009


Hi Conal,

On Tue, Mar 10, 2009 at 12:50:13PM -0700, Conal Elliott wrote:
> Do ghc and ghci handle CPP differently?  In ghci, I'm getting "phase `C
> pre-processor' failed (exitcode = 1)" when I #include the same .h file more
> than once in a module.  I also get warnings about a symbol being redefined,
> although I'm careful to #undef them it the end of the include file.  All
> works fine with ghc.

Your problem seems to be that cpp can't find ApplicativeNumeric-inc.hs
when run by ghci:

>     Graphics/Shady/Vec.hs:134:0:
>      error: ApplicativeNumeric-inc.hs: No such file or directory

It looks to me like ghc and ghci are calling cpp in the same way, so if
you can't see what the problem is then can you please let us know what
version of GHC you are using, exactly what commands you are running, and
give us a complete reproducible testcase?


Thanks
Ian



More information about the Glasgow-haskell-bugs mailing list