Operating System - HP-UX
1830407 Members
3810 Online
110002 Solutions
New Discussion

JNI shared library using GCC3.2 on 64 bit HP-UX11.11 ??? HELP!!!

 
rudi simic
New Member

JNI shared library using GCC3.2 on 64 bit HP-UX11.11 ??? HELP!!!

I am really getting desperate over this so I would appreciate it if somone could find the time to help me.

Is it possible to create a shared *.sl library using gcc3.2 on HP-UX11.11 that can be accessed with the HP JAVA JRE 2.2.08 through JNI????

I'm getting the error: Exception in thread "main" java.lang.UnsatisfiedLinkError: MYFILE.sl: Exec format error

so the java runtime is finding the file but it's of the wrong format.

i'm compiling with gcc: -O4 -fPIC
and linking with: -shared

when i do objdump on the resulting binary it says:?

================================= blah.sl: file format elf64-hppa

SYMBOL TABLE: 40000000000001c8 l d .dynamic...

================================= however, if if i look at an existing *.sl file in the /lib directory i get ?

=================================

/lib/libsec.sl: file format som

SYMBOL TABLE:?

400018e8 l $DATA$ DS$accept_pw_sl?

==================================

A DIFFERENT FORMAT!!!

so - anyone have any idea?

am i going to have to buy the hp compiler?

regards, rudi...

1 REPLY 1
Mike Stroyan
Honored Contributor

Re: JNI shared library using GCC3.2 on 64 bit HP-UX11.11 ??? HELP!!!

You are using the wrong gcc compiler. There are different versions of gcc for building programs with 32-bit and 64-bit pointers. Java uses 32-bit pointers, so you need the 32-bit gcc. You can get that from
http://h21007.www2.hp.com/dspp/tech/tech_TechSoftwareDetailPage_IDX/1,1703,547,00.html