<div dir="ltr">Dear all,<div><br></div><div>maybe this is a piece of c2hs behaviour I missed to understand, but it appears happening with C++ style includes deep in the header call hierarchy – in case of a such backend C++ library, if one wishes to refer to by *.h's in c2hs (e.g. for access to types of it), one might have a problem.</div>
<div><br></div><div>- 8< cSample.h ---------------------------------------------</div><div>#include <iostream> ///////// here, with c2hs, leading to build abort<br></div><div>#ifdef __cplusplus<br></div><div>extern "C" {</div>
<div>#endif</div><div>void sampleFunction();</div><div>#ifdef __cplusplus</div><div>}</div><div>#endif</div>- 8< cSample.cpp ---------------------------------------------<div><div>#include "cSample.h" </div><div>
#include <iostream> ///////// here no problem</div><div><br></div><div>void sampleFunction(){ </div><div>  std::cout << "OK" << std::endl;</div><div>}</div>- 8< ----------------------------------------------------------------<div>
<br></div><div>While 'old school' FFI (foreign import ccall) handles this effortlessly, c2hs uses to abort with an exception like </div><div><div>C/cSample.h:3:20: fatal error: iostream: No such file or directory</div>
<div>compilation terminated.</div></div><div><br></div><div>I see that hsqml gets around this, but apparently by tweaking Setup.hs in a way not quite trivial – would this be necessary in any case, or are there simpler alternatives?</div>
<div><br></div><div>Please excuse if I oversaw something, but I am afraid I didn't see this interesting issue covered elsewhere.</div><div><br></div><div>Thank you a lot in advance & cheers, Nick</div><div><br></div>
<div><br></div><div><br></div><div><br></div><div><br></div><div><br></div></div></div>