[C2hs] Re: [Haskell-cafe] more problems with c2hs

Ruben Zilibowitz rubenz at cse.unsw.edu.au
Thu Apr 12 19:49:33 EDT 2007

Thanks for pointing to the appropriate mailing list. This is what  
appears to be happening.
file.chs has a line: #include "file.h"
After running:
c2hs file.chs
file.h gets modified so that it contains just:
#include "file.h"

So I lose the contents of file.h every time I run c2hs! Running cpp - 
x c file.h by itself doesn't have that effect so the problem must be  
caused by c2hs somehow. What is wrong with my c2hs? Perhaps the darcs  
version has some bugs in it.


On 13/04/2007, at 9:01 AM, Duncan Coutts wrote:

> On Fri, 2007-04-13 at 02:37 +1000, Ruben Zilibowitz wrote:
>> Hi,
>> I've built and installed c2hs on my Mac OS X system now. I read
>> through the research paper on c2hs available on the website for c2hs
>> and decided I would need to try it out to learn it. But it gives me
>> errors which I am having trouble trying to understand. Here are the
>> error messages:
>> c2hs file.chs
>> powerpc-apple-darwin8-gcc-4.0.1: c: No such file or directory
>> powerpc-apple-darwin8-gcc-4.0.1: c: No such file or directory
>> powerpc-apple-darwin8-gcc-4.0.1: warning: '-x -x' after last input
>> file has no effect
>> powerpc-apple-darwin8-gcc-4.0.1: no input files
>> c2hs: Error during preprocessing custom header file
> c2hs runs cpp -x c ${header}
> for the header file you specify. You can either specify a header  
> file on
> the commend line or use #include's in the .chs file. c2hs should
> generate a .h file itself in that case but it looks like it isn't for
> some reason. You can find out what it is really doing by running:
> c2hs --dump trace file.chs
> btw, the better mailing list for this stuff is the c2hs mailing list:
> c2hs at haskell.org
> Duncan

More information about the C2hs mailing list