Operating System - HP-UX
1757022 Members
2287 Online
108858 Solutions
New Discussion юеВ

Re: JNI compilation/linking issues on an HP-UX IA64 using gcc

 
Dennis Handly
Acclaimed Contributor

Re: JNI compilation/linking issues on an HP-UX IA64 using gcc

Here is the JNI documentation. You might try out the sample first:
http://docs.hp.com/en/JAVAPROGUIDE/JNI_java2.html#java_native_c
nallamolu
Advisor

Re: JNI compilation/linking issues on an HP-UX IA64 using gcc

Hi Dennis,

I have gone through the link which u have send
> http://docs.hp.com/en/JAVAPROGUIDE/JNI_java2.html#java_native_c

In this link i found a statement which states as follows...
""
On Integrity, create the shared library using:

$ aCC -b -o libaCCImpl.so aCCImpl.o \
-lstd_v2 -lCsup -lunwind -lm

On Integrity, the -AA lib -lstd_v2 is necessary, otherwise, running the program will result in UnsatisfiedLinkErrors.

""

Does we have an option -lstd_v2 in gcc.
Where we need to include this option ie in compilation or linking.

In advance i wish u Very Happy New Year

Regards,
Gopi
Dennis Handly
Acclaimed Contributor

Re: JNI compilation/linking issues on an HP-UX IA64 using gcc

>I found a statement which states as follows ... running the program will result in UnsatisfiedLinkErrors.

This should be for aC++ only, not C.

>Do we have an option -lstd_v2 in gcc?
>Where we need to include this option ie in compilation or linking.

This is a link option but I can't see how it would make it work, since you don't have any unsats.
What are the names of your native methods and are they in your shlib?
nm -px libIntroscopeHPUXItanium64Stats.so | grep " [TBD] "
nallamolu
Advisor

Re: JNI compilation/linking issues on an HP-UX IA64 using gcc

Hi Dennis,

> nm -px libIntroscopeHPUXItanium64Stats.so | grep " [TBD] "

$ nm -px libIntroscopeHPUXItanium64Stats.so | grep " [TBD] "
0x4000000000001ca0 T JNU_ThrowByName
0x4000000000003000 T Java_com_hpux_HPUXPlatformStatisticsBackEnd_getAggregateCPUUsage
0x4000000000001ea0 T Java_com_hpux_HPUXPlatformStatisticsBackEnd_getCPUIndexMap
0x4000000000002ee0 T Java_com_hpux_HPUXPlatformStatisticsBackEnd_getParentProcessID
0x40000000000023a0 T Java_com_hpux_HPUXPlatformStatisticsBackEnd_getProcessCPUUsage
0x4000000000002dc0 T Java_com_hpux_HPUXPlatformStatisticsBackEnd_getProcessID
0x4000000000002d50 T Java_com_hpux_HPUXPlatformStatisticsBackEnd_getProtocolVersion
0x4000000000003be0 T Java_com_hpux_HPUXPlatformStatisticsBackEnd_getThreadCpuTime
0x40000000000025e0 T Java_com_hpux_HPUXPlatformStatisticsBackEnd_getTotalClockTicks
0x4000000000002d80 T Java_com_hpux_HPUXPlatformStatisticsBackEnd_init
0x4000000000003bb0 T Java_com_hpux_HPUXPlatformStatisticsBackEnd_isThreadCpuTimeEnabled
0x4000000000002da0 T Java_com_hpux_HPUXPlatformStatisticsBackEnd_term
0x40000000000002b0 D _DYNAMIC


1.) What are the compiling options for aCC(aC++) to compile in 64 bit mode ( HP-UX IA64 ).
Is it +DD64

> What are the names of your native methods and are they in your shlib?

The names of the native methods u can see above.

Does we nee to set shlib path. if yes to which location we need to set.
Dennis Handly
Acclaimed Contributor

Re: JNI compilation/linking issues on an HP-UX IA64 using gcc

>1) What are the compiling options for aCC(aC++) to compile in 64 bit mode? Is it +DD64

Yes.

>The names of the native methods you can see above.

How are they declared in java?
Is this some class name? Java_com_hpux
What is JNU_ThrowByName for?

>Do we need to set SHLIB_PATH?

No, you aren't using any other shlibs.

I suppose you could use gdb to see what dl* functions are being called, dlopen, dlsym.