defcfun cannot find foreign function in library

Reini Urban rurban at x-ray.at
Wed Jun 26 12:40:09 UTC 2013


On Tue, Jun 25, 2013 at 3:22 AM, Luís Oliveira
<loliveira at common-lisp.net> wrote:
> On Tue, Jun 25, 2013 at 1:56 AM, Mirko Vukovic <mirko.vukovic at gmail.com> wrote:
>> I am trying to link to a VISA library (VISA is used to control data
>> acquisition instruments), visa32.lib compiled for Windows.  The library is
>> shipped with Tektronix software.
>
> I'm surprised loading it works. That sounds like a static library.
>
>> Using `nm' I did find:
>> 00000000 I __imp__viOpenDefaultRM at 4
>> 00000000 T _viOpenDefaultRM at 4

.lib is the naming convention for an MSVC import library, forwarding to a .dll.
In cygwin and mingw it is usually named .dll.a.
See the I type, and the __imp__ prefix.

With gnu binutils you can find the matching dll
(they have versioned names, and no symlink support)
via dllimport -I libname

--
Reini Urban
http://cpanel.net/   http://www.perl-compiler.org/



More information about the cffi-devel mailing list