<div dir="ltr"><div>[An answer to my own question in the hope to help others experimenting the same problem]</div><div><br></div><div>Hi,</div><div><br></div><div>I found the following hack to overcome the problem:</div><div>
<br></div><div>The name of the header file included at the top of the generated c file is defined in the variable COMPILER::*cmpinclude*.  It is therefore possible to overwrite the variable and to include a different file.  Using my own header file which first includes StdAfx.h and after the header defined by the original value of COMPILER::*cmpinclude* solves the problem...</div>
<div><br></div><div>Here in more detail:</div><div><br></div><div>--- RhinoLispPrologue.h ---</div><div>#include "StdAfx.h"</div><div>#include <ecl/ecl-cmp.h></div><div>---</div><div><br></div><div>I then build the library with</div>
<div><br></div><div>  (let ((COMPILER::*cmpinclude* "\"RhinoLispPrologue.h\""))</div><div>    (asdf:make-build system ...)</div><div><br></div><div>Thanks,</div><div><br></div><div>Dietrich</div><div><br>
</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, Jul 7, 2013 at 9:22 PM, Dietrich Bollmann <span dir="ltr"><<a href="mailto:dietrich@formgames.org" target="_blank">dietrich@formgames.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi,<div><br></div><div>I am trying to use ECL as scripting language for a large Windows program (Rhino3D).</div>
<div><br></div><div>When including the precompiled headers required by Rhino plugins with</div>
<div><br></div><div><div>   (ffi:clines "#include \"StdAfx.h\")</div><div><br></div><div>and building the library with (asdf:make-build system :type :shared-library ...)</div><div><br></div>
<div>I get the following error:</div><div><br></div><div>  fatal error C1189: #error :  WINDOWS.H already included.  MFC apps must not #include <windows.h><br></div><div><br></div><div>
Moving the include statement to the very top of the generated c file (before the #include <ecl/ecl-cmp.h> sttement), however, and compiling manually works.</div><div><br></div><div>I tried to make use of the "prologue-code" option and solve the problem by prepending the include statement to the generated code as follows:</div>

<div><br></div><div>  (asdf:make-build system :type :shared-library :prologue-code "#include \"StdAfx.h\"" ...)</div><div><br></div><div>But the prologue-option string was not inserted anywhere into the generated code.</div>

<div><br></div><div>Any idea about how to solve the problem?</div><div><br></div><div>Thanks for your help,</div><div><br></div><div>Dietrich</div><div><br></div></div></div>
</blockquote></div><br></div>