Discussion:
[Larceny-users] MinGW and the FFI
David Rush
2009-12-13 15:32:15 UTC
Permalink
Are there any special things I need to know in order to use the FFI
with MinGW-built DLLs? I've built a DLL using

gcc --version
gcc (GCC) 3.2.3 (mingw special 20030504-1)
Copyright (C) 2002 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

and while I appear to be able to load it, the symbols which I put in
the DLL all appear to be unfindable by foreign-procedure. I've used
both the source-code form and the library form (as reported by nm) of
the names in question and I uniformly get
(define rtaudio-abort-stream (foreign-procedure "_RTAWAbortStream" '(int) 'void* 'cdecl))
Error: ffi/find-procedure: procedure : _RTAWAbortStream can't be found.
Entering debugger; type "?" for help.
debug> q


david rush
--
GPG Public key at http://cyber-rush.org/drr/gpg-public-key.txt
David Rush
2009-12-13 15:32:52 UTC
Permalink
I should have said: this is larceny 0.97...
Post by David Rush
Are there any special things I need to know in order to use the FFI
with MinGW-built DLLs? I've built a DLL using
gcc --version
gcc (GCC) 3.2.3 (mingw special 20030504-1)
Copyright (C) 2002 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
and while I appear to be able to load it, the symbols which I put in
the DLL all appear to be unfindable by foreign-procedure. I've used
both the source-code form and the library  form (as reported by nm) of
the names in question and I uniformly get
(define rtaudio-abort-stream (foreign-procedure "_RTAWAbortStream" '(int) 'void* 'cdecl))
Error: ffi/find-procedure: procedure : _RTAWAbortStream  can't be found.
Entering debugger; type "?" for help.
debug> q
david rush
--
GPG Public key at http://cyber-rush.org/drr/gpg-public-key.txt
--
GPG Public key at http://cyber-rush.org/drr/gpg-public-key.txt
David Rush
2009-12-17 23:45:08 UTC
Permalink
There is no secret or difficulty in using a MinGW dll from larceny
Well it's pretty clear that I was suffering from some kind of a brain fart.
After rebuilding everything in my DLL and working with the lowest levels of
the larceny FFI (ffi/dlsym) everything just seems to work. Go figure.

david
--
GPG Public key at http://cyber-rush.org/drr/gpg-public-key.txt
Loading...