Hi Ralf Mattes,

Thank you very much for your answer!

> I think you'll find the best sample code in the eql project -
> just do a "git clone git://gitorious.org/eql/eql.git"
>
> This project embeds all of Qt into ECL.

I thought the same and therefore searched the EQL sources before writing my
last email.  I had the impression that EQL (beyond the simple code in
lisp/ecl-readline.lisp) is based on CFFI which, as far as I understand,
currently does not work with ECL under MSVC++.

If I am not mistaken, in this environment currently the only way to access
foreign functions from ECL is to use ECL's own built-in foreign function
interface, tocompile the code accessing C or C++ functionality into a
static library (as dynamic loading from CFFI seems to not work in the
moment) and to link the latter statically to the rest of the code.

Is this a misunderstanding?

For the case that ECL's own FFI is the only way which currently works with
Microsoft's compilers, I had the impression that ECL's ecl_*foreign_data*()
functions have to be used to wrap a pointer to a C++ class instance into a
lisp object.  But I could not find any usable example and (at least until
now) was not successful in producing some working code myself...

If this impression is wrong, please correct me!

If it happens to be correct and somebody has an idea about how to wrap the
simple C++ example from my last email into lisp, I would be most grateful!

Thanks a lot, Dietrich

Here the relevant part of my last email:

On Thu, Jun 6, 2013 at 6:25 PM, Dietrich Bollmann <dietr...@formgames.org>
 wrote:
>
> How, for example, would I wrap the following simple program?
>
>   ;; Making a cube of size 2
>   Cube* cube = new Cube(2.0);
>
>   ;; Changing its size to 10
>   cube->setSize(10.0);
>
>   ;; Getting its size
>   cube->getSize();
>
>   ;; Deleting the object
>   delete cube;
>
> based on a class like the following
>
>   class Cube {
>   private:
>     double _size;
>   public:
>     Cube(): _size(1.0) {}
>     Cube(const double size): _size(size) {}
>     void setSize(const double size) { _size = size; }
>     double getSize() const { return _size; }
>   };
>
> ?
>

On Thu, Jun 6, 2013 at 11:20 PM, R. Mattes <r...@mh-freiburg.de> wrote:

> On Thu, 6 Jun 2013 18:25:00 +0900, Dietrich Bollmann wrote
> > Hi,
> >
> > Is there some example about how to wrap C++ classes with ECLs foreign
> function interface?
>
> I think you'll find the best sample code in the eql project -
> just do a "git clone git://gitorious.org/eql/eql.git"
>
> This project embeds all of Qt into ECL.
>
>  HTH Ralf Mattes
>
> --
>  R. Mattes -
>  Hochschule fuer Musik Freiburg
>  r...@inm.mh-freiburg.de
>
>
------------------------------------------------------------------------------
How ServiceNow helps IT people transform IT departments:
1. A cloud service to automate IT design, transition and operations
2. Dashboards that offer high-level views of enterprise services
3. A single system of record for all IT processes
http://p.sf.net/sfu/servicenow-d2d-j
_______________________________________________
Ecls-list mailing list
Ecls-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ecls-list

Reply via email to