Operating System - HP-UX
1819997 Members
3869 Online
109608 Solutions
New Discussion юеВ

JNI calling C shared lib, calling C shared lib

 
SOLVED
Go to solution
Kevin Heffernan
New Member

JNI calling C shared lib, calling C shared lib

I have a java application running on HPUX 11.0 which calls a C shared library (call it gridAPI.sl). This gridAPI.sl then makes calls to a PostgreSQL shared library to access data. The java finds the gripAPI.sl but at runtime I get an Unsatisfied Symbol error on EPCGconnect call in the second (PostgeSQL) shared library. Why can't gridAPI.sl find the PostgeSQL shared library? The chain works fine when the initiating program is 'C'.
4 REPLIES 4
David Kilcy
Frequent Advisor
Solution

Re: JNI calling C shared lib, calling C shared lib

I dont know what compiler you are using but we had much better success using the gcc compiler rather than aCC.

Just for double checking, did you make sure the PostgwSQL library is in your LD_LIBRARY_PATH?

If your using aCC, I think you also need to use the -L and +Wl,-b options..

Sorry im just thinking off the top of my head.
David Kilcy
Frequent Advisor

Re: JNI calling C shared lib, calling C shared lib

Sorry, for HPUX the path is SHLIB_PATH (Solaris uses LD_LIBRARY_PATH)
asdf_44
Occasional Advisor

Re: JNI calling C shared lib, calling C shared lib

Can you please give an example of how to properly compile and link using gcc? I am especially interested in the case where one shared library is linked to another. Thanks,

TJ
Kevin Heffernan
New Member

Re: JNI calling C shared lib, calling C shared lib

SHLIB_PATH was all set. Had to use aCC by direction (this is a small part of a large project). The compiler/linker options were the key. Thanks.