On Fri, 17 Dec 1999 11:49:32 +1100, Mitch Davis <[EMAIL PROTECTED]> wrote:
Hi Mitch,
>I'm using Active State Perl 5.005_03 build 522 for Win32.
>I would like to call some routines in a DLL. This has
>been a long and rocky road, but that's not my current problem.
I hope you got that part solved. It basically works as described in the
perlxs etc pages. Just make sure you specify the libraries in your LIBS
section in Makefile.PL.
>I have this C function:
>
>extern signed long viOpenDefaultRM (unsigned long *vi);
>
>I'd like to call this func from Perl. Here's what I have in the
>.xs file: (plus lots of other stuff like constant handling
>code that I haven't shown). [1]
>
>signed long
>viOpenDefaultRM(vi)
> unsigned long *vi
>
>When I compile this, here's what I get:
>
>hpiw0300 [//c/My\ Documents/VISA] nmake
> C:\Perl\bin\perl.exe -IC:\Perl\lib -IC:\Perl\lib C:\Perl\lib\ExtUtils/xsubpp
>-typemap C:\Perl\lib\ExtUtils\typemap VISA.xs >xstmp.c && C:\Perl\bin\perl.exe
>-IC:\Perl\lib -IC:\Perl\lib -MExtUtils::Command -e mv xstmp.c VISA.c
>Error: 'signed long' not in typemap in VISA.xs, line 135
>NMAKE : fatal error U1077: 'C:\Perl\bin\perl.exe' : return code '0x1'
>
>I've had a look at the C:\Perl\lib\ExtUtils\typemap file [2],
>and it has entries for unsigned integers, but not signed integers.
>
>Can anyone enlighten me on why there's no (apparent) typemap conversion
>for signed integers please? Alternatively, what might I be doing
>wrong?
"signed long" is just a "long" and "signed int" is just an "int".
>PS: If anyone's been down this calling-a-dll-from-Perl-for-Win32
>road before, I would be very glad to hear from you.
Well, look at any of the Win32::* extensions; they are all (well, most)
calling DLL functions from Perl (via XS). Many call functions from the
system libraries, which are automatically made available during link time,
so they don't do any LIBS munging.
It would help to get a specific question about what is not working.
-Jan