From relativeflux at hotmail.co.uk Sat Mar 15 18:57:12 2008 From: relativeflux at hotmail.co.uk (Christopher Melen) Date: Sat, 15 Mar 2008 18:57:12 +0000 Subject: [fetter-devel] CFFI::DEFCTYPE* in cairo.lisp - undefined? Message-ID: Hi, I'm experimenting with Verrazano on WinXP (in Cygwin's Clisp), but I'm having a problem with the cairo.lisp test (using Cygwin's native cygcairo-2.dll in place of libcairo.so). I get the following error - [1]> (load "/cygdrive/c/verrazano/verrazano/tests/cairo.lisp") ;; Loading file /cygdrive/c/verrazano/verrazano/tests/cairo.lisp ... ; loading system definition from /home/Chris/asdf/asdf_registry/cffi.asd into # ;; Loading file /home/Chris/asdf/asdf_registry/cffi.asd ... ; registering # as CFFI ;; Loaded file /home/Chris/asdf/asdf_registry/cffi.asd ;; Loading file /cygdrive/c/verrazano/cffi/src/utils.fas ... ;; Loaded file /cygdrive/c/verrazano/cffi/src/utils.fas ;; Loading file /cygdrive/c/verrazano/cffi/src/features.fas ... ;; Loaded file /cygdrive/c/verrazano/cffi/src/features.fas ;; Loading file /cygdrive/c/verrazano/cffi/src/cffi-clisp.fas ... ;; Loaded file /cygdrive/c/verrazano/cffi/src/cffi-clisp.fas ;; Loading file /cygdrive/c/verrazano/cffi/src/package.fas ... ;; Loaded file /cygdrive/c/verrazano/cffi/src/package.fas ;; Loading file /cygdrive/c/verrazano/cffi/src/libraries.fas ... ;; Loaded file /cygdrive/c/verrazano/cffi/src/libraries.fas ;; Loading file /cygdrive/c/verrazano/cffi/src/early-types.fas ... ;; Loaded file /cygdrive/c/verrazano/cffi/src/early-types.fas ;; Loading file /cygdrive/c/verrazano/cffi/src/types.fas ... ;; Loaded file /cygdrive/c/verrazano/cffi/src/types.fas ;; Loading file /cygdrive/c/verrazano/cffi/src/enum.fas ... ;; Loaded file /cygdrive/c/verrazano/cffi/src/enum.fas ;; Loading file /cygdrive/c/verrazano/cffi/src/strings.fas ... ;; Loaded file /cygdrive/c/verrazano/cffi/src/strings.fas ;; Loading file /cygdrive/c/verrazano/cffi/src/functions.fas ... ;; Loaded file /cygdrive/c/verrazano/cffi/src/functions.fas ;; Loading file /cygdrive/c/verrazano/cffi/src/foreign-vars.fas ... ;; Loaded file /cygdrive/c/verrazano/cffi/src/foreign-vars.fas 0 errors, 0 warnings ;; Loading file /home/Chris/asdf/asdf_registry/verrazano.asd ... ;; Loaded file /home/Chris/asdf/asdf_registry/verrazano.asd ;; Loading file /cygdrive/c/verrazano/verrazano/example-bindings/cairo-cffi-bindings.lisp ... ; loading system definition from /home/Chris/asdf/asdf_registry/verrazano-runtime.asd into # ;; Loading file /home/Chris/asdf/asdf_registry/verrazano-runtime.asd ... ; registering # as VERRAZANO-RUNTIME ;; Loaded file /home/Chris/asdf/asdf_registry/verrazano-runtime.asd ;; Loading file /cygdrive/c/verrazano/verrazano/runtime/support.fas ... ;; Loaded file /cygdrive/c/verrazano/verrazano/runtime/support.fas 0 errors, 0 warnings *** - COMMON-LISP:EVAL: undefined function CFFI::DEFCTYPE* The following restarts are available: USE-VALUE :R1 You may input a value to be used instead of (COMMON-LISP:FDEFINITION 'CFFI::DEFCTYPE*). RETRY :R2 Retry STORE-VALUE :R3 You may input a new value for (COMMON-LISP:FDEFINITION 'CFFI::DEFCTYPE*). SKIP :R4 skip (DEFCTYPE* CAIRO-STATUS-T _CAIRO-STATUS) STOP :R5 stop loading file /cygdrive/c/verrazano/verrazano/example-bindings/cairo-cffi-bindings.lisp SKIP :R6 skip (LOAD #) STOP :R7 stop loading file /cygdrive/c/verrazano/verrazano/tests/cairo.lisp ABORT :R8 COMMON-LISP:ABORT I looked at the my CFFI sources and defctype* doesn't appear to be defined anywhere. But it appears at several points in cairo-cffi-bindings.lisp. I tried using defctype instead, but that caused even more errors (lots of undefined types, if I recall correctly). Any suggestions? Many thanks, Chris _________________________________________________________________ Telly addicts unite! http://www.searchgamesbox.com/tvtown.shtml -------------- next part -------------- An HTML attachment was scrubbed... URL: From attila.lendvai at gmail.com Sat Mar 15 21:00:45 2008 From: attila.lendvai at gmail.com (Attila Lendvai) Date: Sat, 15 Mar 2008 22:00:45 +0100 Subject: [fetter-devel] CFFI::DEFCTYPE* in cairo.lisp - undefined? In-Reply-To: References: Message-ID: > *** - COMMON-LISP:EVAL: undefined function CFFI::DEFCTYPE* you need the latest cffi, or if that's not enough you need to: darcs get http://common-lisp.net/~loliveira/darcs/cffi+lotsastuff/ -- attila From relativeflux at hotmail.co.uk Sun Mar 16 00:47:05 2008 From: relativeflux at hotmail.co.uk (Christopher Melen) Date: Sun, 16 Mar 2008 00:47:05 +0000 Subject: [fetter-devel] vectors Message-ID: Hi, I've generated some bindings for a c++ library which makes copious use of vectors. This results in lots of commas in the bindings file, which Lisp complains about, naturally ('comma is illegal outside of backquote'). Is there any way to deal with this? Does CFFI not cater for vectors? Many thanks, Chris _________________________________________________________________ Share what Santa brought you https://www.mycooluncool.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From attila.lendvai at gmail.com Sun Mar 16 12:15:53 2008 From: attila.lendvai at gmail.com (Attila Lendvai) Date: Sun, 16 Mar 2008 13:15:53 +0100 Subject: [fetter-devel] vectors In-Reply-To: References: Message-ID: > I've generated some bindings for a c++ library which makes copious use of > vectors. This results in lots of commas in the bindings file, which Lisp > complains about, naturally ('comma is illegal outside of backquote'). Is > there any way to deal with this? Does CFFI not cater for vectors? c++ is such a big kludge that we (me and Levente) almost reached the conclusion that supporting c++ is hopeless and pointless... the new branch at http://common-lisp.net/cgi-bin/darcsweb/darcsweb.cgi?r=fetter-verrazano.flexml;a=summary contains code that deals with such things by skipping templated stuff for now. but if you need STL vectors then it won't help much i guess. all in all, a lot is missing for being able to generate useful c++ bindings. first there should be a compiler plugin architecture that abstracts away vtables and name mangling. and then a lot more is missing to handle the numerous other details. we may spend a few more days trying to make it work, but i don't promise anything... -- attila From relativeflux at hotmail.co.uk Wed Mar 19 20:59:23 2008 From: relativeflux at hotmail.co.uk (Christopher Melen) Date: Wed, 19 Mar 2008 20:59:23 +0000 Subject: [fetter-devel] foreign-type problem (Cygwin Clisp) Message-ID: Hi again, To update on my previous problems: I've since discovered a C interface to the C++ library I've been trying to generate bindings for, and I can now load the resultant bindings file. :) I have a new problem, though (which is probably CFFI-specific, but I thought it best to post here as I'm only using CFFI in the context of Verrazano). When I try and call any of my generated functions I get errors which I don't understand. For example the following function - TEST[4]> (analyzer-configure (* .8 415.0) 415.0) *** - FFI::FOREIGN-CALL-OUT: 332.0 cannot be converted to the foreign type DOUBLE-FLOAT Here is how it's defined in my bindings - (cffi:defcfun ("analyzer_configure" analyzer-configure) :void (resolution :double) (windowWidth :double)) The function configures an FFT analyzer. But why is the standard Lisp type double-float being referred to as a foreign type? Or am I not understanding things correctly? Cheers for any suggestions, Chris _________________________________________________________________ Telly addicts unite! http://www.searchgamesbox.com/tvtown.shtml -------------- next part -------------- An HTML attachment was scrubbed... URL: From relativeflux at hotmail.co.uk Wed Mar 19 23:29:56 2008 From: relativeflux at hotmail.co.uk (Christopher Melen) Date: Wed, 19 Mar 2008 23:29:56 +0000 Subject: [fetter-devel] foreign-type problem (Cygwin Clisp) Message-ID: Just to add that I get the same problem with the testsuite (in Clisp) - [1]> (load "/cygdrive/c/verrazano/verrazano/tests/cairo.lisp") [lots deleted]... ;; Loaded file /cygdrive/c/verrazano/verrazano/example-bindings/cairo-cffi-bindings.lisp *** - FFI::FOREIGN-CALL-OUT: NIL cannot be converted to the foreign type FFI:INT I'm loading cygcairo-2.dll with those bindings. Chris _________________________________________________________________ Share what Santa brought you https://www.mycooluncool.com -------------- next part -------------- An HTML attachment was scrubbed... URL: