Operating System - HP-UX
1753792 Members
6831 Online
108799 Solutions
New Discussion юеВ

aCC -AA compiled shared library in JNI environment

 
Venkat Chandrasekaran
Occasional Advisor

aCC -AA compiled shared library in JNI environment

When I attempt to use a shared library built using aCC -AA in a Java 1.3 JNI environment, I get a lot of unresolved externals errors from ldd., most of them relating to streams. Is there a way to prevent this? Thanks!

2 REPLIES 2
Mike Stroyan
Honored Contributor

Re: aCC -AA compiled shared library in JNI environment

Version 1.4.1.03 was the first java for PA-RISC that allowed JNI to use aCC -AA. That is noted in the release notes 1.4.1.03 at-
http://www.hp.com/products1/unix/java/java2/sdkrte14/infolibrary/sdk_rnotes_1.4.0.03.html#C++
Mike Stroyan
Honored Contributor

Re: aCC -AA compiled shared library in JNI environment

Oh, I see that the release note details are really focused on starting a jvm from an aCC program. You want to load aCC JNI from the java main. You should review the notes on linking aCC code into a JNI library at-
http://www.hp.com/products1/unix/java/infolibrary/prog_guide/java1_3/JNI_java2.html#java_native_ac++
You will need to change the -lCsup and -lstd libraries from those link instructions to -lCsup_v2 and -lstd_v2 libraries. You will still need the 1.4.1.03 or newer version of java to allow it to coexist with aCC -AA code.
As hinted at in /opt/java1.4/java.os11.release.notes,
that release can use a SHLIB_PATH trick to get java libraries to use libCsup_v2.sl instead of libCsup.sl. SHLIB_PATH=/opt/java1.4/jre/lib//CXX
causes references to libCsup.sl from libjvm.sl and libfontmanager.sl to really use libCsup_v2.sl.