<div dir="ltr">Hi Juanjo,<div><br></div><div style>Thank you! </div><div style><br></div><div style>It was too late in the night when I wrote this email to think clearly: I tried to apply my experiences from embedding C++ code via the ECL FFI on my Mac to Windows... Not a good strategy :)</div>
<div style><br></div><div style>In both cases I got the same error messages being caused by the compiler misinterpreting the C++ code as C code.</div><div style><br></div><div style>In the case of my Mac recompiling ECL with<span style="font-family:arial,sans-serif;font-size:13px"> </span><span style="font-family:arial,sans-serif;font-size:13px">'--with-cxx' was the solution. </span></div>
<div style><br></div><div style>On Windows, however, the problem is caused by 'asdf:make-build' generating a file with the extension .c which makes the compiler interpreting the code as C code. The command line option /TP can be use to force the compiler to interpret the content of the file as C++ code. (See the page "/Tc, /Tp, /TC, /TP (Specify Source File Type)" at <a href="http://msdn.microsoft.com/en-us/library/032xwy55.aspx">http://msdn.microsoft.com/en-us/library/032xwy55.aspx</a> .)<br>
</div><div style><br></div><div style><font face="arial, sans-serif">Doing so a second error is thrown: error C4716: 'main_lib_CUBE' : must return a value ('cube' is the name I called the library). </font><span style="font-family:arial,sans-serif">The option /wo4716 can be used to turn it into a warning resulting in the library being built. </span>(See "/w, /Wn, /WX, /Wall, /wln, /wdn, /wen, /won (Warning Level)" at <a href="http://msdn.microsoft.com/en-us/library/thxezb7y.aspx">http://msdn.microsoft.com/en-us/library/thxezb7y.aspx</a> )</div>
<div style><br></div><div style>Here my current solution which builds the library:</div><div style><br></div><div style>In my Makefile:</div><div style><br></div><div style>--- Makefile---</div><div style>...</div><div style>
<div>cube.lib: cube.asd cube.lisp Cube.obj</div><div><span class="" style="white-space:pre"> </span>ecl -norc -load cube-build.lisp</div><div>...</div><div>---</div><div><br></div><div style>The file with the LISP code used to build the library:</div>
<div style><br></div><div style>--- cube-build.lisp ---</div><div style><div>(ext:install-c-compiler)</div><div>(require :asdf)</div><div>(push "./" asdf:*central-registry*)</div><div>(let ((COMPILER::*cc-flags* (concatenate 'string COMPILER::*cc-flags* " /TP /wo4716 "))</div>
<div> (COMPILER::*ld-bundle-flags* (concatenate 'string COMPILER::*ld-bundle-flags* " Cube.obj ")))</div><div> (asdf:make-build :cube :type :static-library :move-here "./cube.lib"))</div><div>
(quit)</div></div><div style>---</div><div><br></div><div style>On the long term a better solution might be</div><div style><br></div><div style> - to add some option to 'asdf:make-build' which takes either ':c' or 'cpp' as value (with ':c' being the derault) and generates a file with the respective extension;</div>
<div style> - to change the LISP to C / C++ compiler so that the generated function<span style="font-family:arial,sans-serif"> </span><span style="font-family:arial,sans-serif">'main_lib_NAMEOFLIBRARY'</span> actually returns a value.</div>
<div style><br></div><div style>Thanks for you help,</div><div style><br></div><div style>Dietrich</div><div style><br></div></div><div style><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jun 17, 2013 at 12:36 AM, Juan Jose Garcia-Ripoll <span dir="ltr"><<a href="mailto:juanjose.garciaripoll@gmail.com" target="_blank">juanjose.garciaripoll@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="im"><br>
<div class="gmail_quote">On Sat, Jun 15, 2013 at 11:47 AM, 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:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><br>How can I build ECL on Windows in a way which allows to embed C++ code as well?<br>
<br></blockquote></div><br></div>The Windows compiler is a C++ compiler, AFAIK. You should not need to do anything extra.<span class=""><font color="#888888"><br>
<br clear="all"><div><br></div>-- <br>Instituto de Física Fundamental, CSIC<br>c/ Serrano, 113b, Madrid 28006 (Spain) <br><a href="http://juanjose.garciaripoll.googlepages.com" target="_blank">http://juanjose.garciaripoll.googlepages.com</a>
</font></span></div></div>
</blockquote></div><br></div></div>