Re: Calling external dll from inline perl using gcc on XP




<agarwal.manav@xxxxxxxxx> wrote in message
news:1148021332.352994.161790@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi I'm trying call an external dll from inline using the below perl
code.


use warnings;

use Inline C => Config =>
MYEXTLIB => "C:\\PerlProblem\\p6\\tst.dll",
INC => "-IC:\\PerlProblem\\p6\\";

BUILD_NOISY => 1;

use Inline C => <<'EOC';

#include "dllfct.h"

void greet(){
printf("test1\n");
printf(add(5,6));
printf("test2\n");
}
EOC
greet();
__END__

I'm getting the following error when I run the perl file.

C:\PerlProblem\test\p6>perl CallExternal.pl
dmake.exe: makefile: line 849: Error -- Missing targets or
attributes in rule

A problem was encountered while attempting to compile and install your
Inline
C code. The command that failed was:
dmake > out.make 2>&1

The build directory was:
C:\PerlProblem\test\p6\_Inline\build\CallExternal_pl_20ad

To debug the problem, cd to the build directory, and inspect the output
files.

at CallExternal.pl line 9
BEGIN failed--compilation aborted at CallExternal.pl line 18.

Can someone please help me solve this? Thanks in advance.


Not sure - I regularly use Inline::C with dmake and gcc (MinGW port) on
Win32 and haven't struck any problem like this. (I've successfully linked to
a dll using the same approach - though it's not something I do a lot.)

Are you using the latest dmake from http://search.cpan.org/dist/dmake/ ?

Does the problem go away if you don't try to link to the dll ?

Cheers,
Rob



.