I can reproduce the problem. I have this method that works: apiInitialize: handle backend: backend host: host port: port "long odbx_init(odbx_t**, char*, char*, char*)" <cdecl: long 'odbx_init' (ulong* char* char* char*) module: 'opendbx'> ^self externalCallFailed But not this one: apiInitialize: handle backend: backend host: host port: port "long odbx_init(odbx_t**, char*, char*, char*)" <cdecl: long 'odbx_init' (ulong* char* char* char*) module: 'opendbx'> ^self externalCallFailed a_piInitialize: handle backend: backend host: host port: port "long odbx_init(odbx_t**, char*, char*, char*)" <cdecl: long 'odbx_init' (ulong* char* char* char* Matching number of arguments expected ->) module: 'opendbx'> ^self externalCallFailed Please, open a ticket. Maybe Lukas can help us. Cheers Mariano On Sat, Aug 21, 2010 at 9:47 PM, Schwab,Wilhelm K <bschwab@anest.ufl.edu>wrote:
I just had an underwhelming response to my latest adventure into FFI, specifically wrapping the Acces IO USB API. Specifically, very few functions survived from description to actually being compiled. AFAICT, the compiler does not like underscores in method names for external functions.
I'm not even sure how to describe it other than to give an example. This works:
dIOWrite8:deviceIndex byteIndex:byteIndex data:data "unsigned long DIO_Write8(unsigned long DeviceIndex, unsigned long ByteIndex, unsigned char Data)"
< cdecl: ulong 'DIO_Write8' ( ulong ulong byte ) > ^self invalidCall.
This should compile, but it complains about a mismatch in the number of arguments:
DIO_Write8:deviceIndex byteIndex:byteIndex data:data "unsigned long DIO_Write8(unsigned long DeviceIndex, unsigned long ByteIndex, unsigned char Data)"
< cdecl: ulong 'DIO_Write8' ( ulong ulong byte ) > ^self invalidCall.
The less Pharo forces us to change names as given from the outside, the better off we will be. I am using a 1.1 RC2 image, just in case this has been fixed since then?? I really need to build a new image soon.
Bill
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project