[Haskell-cafe] How to #include into .lhs files?
Max Bolingbroke
batterseapower at hotmail.com
Fri Feb 4 09:20:45 CET 2011
On 4 February 2011 05:03, Michael Snoyman <michael at snoyman.com> wrote:
> My guess (a complete guess) is that the deliterate step is creating a
> temporary .hs file elsewhere on your filesystem, which is why the CPP
> step can't find B.hs without a fully-qualified path.
That is what is happening (you can confirm with "ghc -v").
Interestingly, you can work around by compiling with -I. on the command line:
{{{
mbolingbroke at equinox ~/Junk/lhscpp
$ cat Test.lhs Included.h
> {-# LANGUAGE CPP #-}
> module Main (main) where
#include "MachDeps.h"
#include "Included.h"
> main :: IO ()
> main = print MY_CONSTANT
#define MY_CONSTANT 2
mbolingbroke at equinox ~/Junk/lhscpp
$ ./Test
2
}}}
Perhaps worth filing a bug report?
Cheers
Max
More information about the Haskell-Cafe
mailing list