<div class="gmail_quote">On Mon, May 3, 2010 at 4:05 PM, Seth Burleigh <span dir="ltr"><<a href="mailto:seth@tewebs.com">seth@tewebs.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<div class="im">How is one supposed to tell the compiler about the function, or in</div>
general any class, class method, structure, etc?<br></blockquote><div><br></div><div>Normally one has a C/C++ library with headers that one includes in the source. The compiler reads the headers (because you have included them) and then infers the types and functions that are defined in the library. Then the library is passed to ECL as an argument (see BUILDER description in the manual) and the linker makes the association such that the compiled code can call the function</div>

<div><br></div><div>What you intended could not work because your function foo() only existed in memory. There was no header that could be reused by other files and no file to be linked against.</div><div><br></div><div>
What my previous messages implied was the following:</div>
<div><br></div><div>* If you are prototyping classes and functions then define them in the same file where they are going to be used. Compile, load and that is all.</div><div><br></div><div>* If the use your prototypes is going to span multiple lisp files then create a C/C++ library. Compile and link the FASL files against it and you're done.</div>

<div><br></div><div>* If you do not feel comfortable with C/C++ please use CFFI and follow the guidelines there. C-INLINE and CLINES imply some knowledge of how linking and loading and compiling phase are implemented. CFFI has a different workflow in which it starts from previously built shared libraries and everything is simpler that way.</div>

<div><br></div><div>Juanjo</div></div><br>-- <br>Instituto de Física Fundamental, CSIC<br>c/ Serrano, 113b, Madrid 28006 (Spain) <br><a href="http://tream.dreamhosters.com">http://tream.dreamhosters.com</a><br>