On 25/10/02 13:55 -0400, [EMAIL PROTECTED] wrote:
> I originally posted this to win32-perl mailing list and was advised this
> may be a better forum.
>
> I have downloaded the Inline::C module for perl. I am able to use it
> effectively with basic C code.
>
> My problem arises when I try to use Inline w/ an application development
> kit, especifically when I try to make Inline know about my header, lib and
> dll files. The code below (minus the inline entries) works w/ ms vc++.
> The LIBS entries are the application development kit lib and dll
>entries,ivadminapi.lib and ivadminapi.dll. The include entry is the adk's header
>files. When I try to execute the
> code from the dos command line, I get this message :
The First Rule of Perl Programming is run with strict and warnings. Add this
to the top of your script:
use warnings;
use strict;
> "Can't modify constant item in scalar assignment at test_c1.pl line 11,
> near ");"
> Execution of test_c1.pl aborted due to compilation errors.
>
> I assume this message is because Inline is not recognizing my lib,dll and
> header files.
>
> use Inline C => Config =>
> LIBS => ['-Lc:\program files\microsoft visual
> studio\vc98\lib -livadminapi.lib',
> '-Lc:\program files\microsoft visual
> studio\vc98\bin -livadminapi.dll'];
This statement is configuration only. It won't compile anything. You need to
change 'Config' to 'DATA'.
>
> ivadmin_context ctx;
> ivadmin_response rsp;
> unsigned long status;
>
> #include "c:\program files\tivoli\policy director\include\ivadminapi.h";
>
> status = ivadmin_context_createdefault("logonid", "password", &ctx, &rsp);
>
> printf("%u\n",status);
OK. So where is the Perl? It seems like you are telling Perl to interpret C
code. Even Inline isn't that good. ;)
>
> __END__
> __C__
>
> print status;
And this is your Perl code? It seems you're a little mixed up on how Inline
works. Here is the basic template:
use warnings;
use strict;
use Inline C => DATA,
LIBS => '-L... -l...';
# Perl code goes here
__END__
__C__
/* C code goes here */
Hope this helps.
Cheers, Brian