----- Original Message ----- 
From: "Patrick LeBoutillier" <[EMAIL PROTECTED]>
To: "Sisyphus" <[EMAIL PROTECTED]>
Cc: "liang nan" <[EMAIL PROTECTED]>; <inline@perl.org>
Sent: Sunday, June 18, 2006 6:06 AM
Subject: Re: Questions about inline::Java


> Rob,
>
> > I'm on Win32, but I don't have Inline::Java (and I don't know if anyone
has
> > managed to successfully install it on Win32).
>
> I know for a fact the Inline::Java works well on Win32 using the
> ActivePerl + MS Visual Studio's C compiler + nmake combination.
>

Yes - so it does. I installed (something like) jdk1.5.0_07 from Sun and
found that Inline::Java-0.51 builds straight out of the box with that
combination.

> However, I can't remember if anyone has been able to make it work using
> other tools.
>

Couldn't *quite* get it to compile straight out of the box using MinGW-built
perl 5.8.8 and dmake. The mantra that one needs to run in this case seems to
be:

1) perl Makefile.PL J2SDK=/path/to/java
2) nmake java ('dmake java' don't work)
3) dmake
4) dmake test
5) dmake install

Unfortunately 'dmake' fails at the very end with:

JNI.o(.text+0xa10):JNI.c: undefined reference to
[EMAIL PROTECTED]
'
JNI.o(.text+0xd66):JNI.c: undefined reference to [EMAIL PROTECTED]'
collect2: ld returned 1 exit status

The problem is that no attempt is made to link to java's jvm.lib .... and
I'm not currently sure of how to patch the source to fix that. (Advice on
that gleefully accepted.)

One solution is, having reached that error, to 'cd' to the 'Java' folder in
the Inline-Java build directory and run:
gcc -shared -o
..\blib\arch\auto\Inline\Java\JNI\JNI.dll -LD:\perl58_M\5.8.8\lib\CORE -LF:\
java\jdk1.5.0_07\lib -lperl58 -ljvm

Obviously others running that command would need to replace
'D:\perl58_M\5.8.8\lib\CORE' with the location of 'libperl58.a', and replace
'F:\java\jdk1.5.0_07\lib' with the location of 'jvm.lib'.

Then 'cd ..' back to the top level build directory and run:
dmake test

followed by:
dmake install

I think the op might have been using ActiveState perl 5.8.8 (as opposed to
MinGW-built perl 5.8.8) with MinGW - in which case exactly the same approach
as outlined above should work.

Eventually I should be able to come up with a patch to the Inline-Java
source that sidesteps the need for that 'orrible kludge (if no-one else
provides the solution in the meantime).

Cheers,
Rob

Reply via email to