HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Unresolved Symbol when calling C code via JNI
Operating System - HP-UX
1829772
Members
7548
Online
109992
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2002 04:26 AM
04-08-2002 04:26 AM
Unresolved Symbol when calling C code via JNI
I'm using Java 1.1.8.04 on HP-UX 10.20.
I have a static library (libStuff.a) with some APIs I need to call from Java. So, I've written a shared library, which links with this static library and makes the calls (libMyStuff.sl). I've written a C executable just to test it out. The executable called the shared library and everything works.
I then created the Java class, with the native methods, and used javah to generate the function prototypes. I tested this with empty implementations and it works (I wanted to make sure I could actually talk to the shared library from Java).
Then, I put the calls to the static library inside the shared library. As soon as I do this, I get the following error when I try to run the Java class:
/usr/lib/dld.sl: Unresolved symbol: SomeAPICall (code) from /somedir/libMyStuff.sl
SIGABRT 6* abort (generated by abort(3) routine)
Sig = 6; code = -1.
stackbase=7B03CE64, stackpointer=7B03E730
IOT trap (core dumped)
So, for some reason it can't find the stuff inside the static library. Oddly, I am linking the static library into the shared library when I build the shared library, so I don't understand why the static library call isn't able to be located by JNI......
Am I missing something? :-)
I have a static library (libStuff.a) with some APIs I need to call from Java. So, I've written a shared library, which links with this static library and makes the calls (libMyStuff.sl). I've written a C executable just to test it out. The executable called the shared library and everything works.
I then created the Java class, with the native methods, and used javah to generate the function prototypes. I tested this with empty implementations and it works (I wanted to make sure I could actually talk to the shared library from Java).
Then, I put the calls to the static library inside the shared library. As soon as I do this, I get the following error when I try to run the Java class:
/usr/lib/dld.sl: Unresolved symbol: SomeAPICall (code) from /somedir/libMyStuff.sl
SIGABRT 6* abort (generated by abort(3) routine)
Sig = 6; code = -1.
stackbase=7B03CE64, stackpointer=7B03E730
IOT trap (core dumped)
So, for some reason it can't find the stuff inside the static library. Oddly, I am linking the static library into the shared library when I build the shared library, so I don't understand why the static library call isn't able to be located by JNI......
Am I missing something? :-)
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2002 04:27 AM
04-08-2002 04:27 AM
Re: Unresolved Symbol when calling C code via JNI
Some more digging has revealed the following.
If I build an executable, which calls the shared library, which in turn calls the static library, I have to link in the static library with the executable itself. i.e. its not enough to link the static library into the shared library.
The problem now is that with JNI, there is no executable. The JVM is directly calling the shared library. So how do I get the static library "stuff" into the shared library so that it can be used indirectly by the JVM via JNI?
If I build an executable, which calls the shared library, which in turn calls the static library, I have to link in the static library with the executable itself. i.e. its not enough to link the static library into the shared library.
The problem now is that with JNI, there is no executable. The JVM is directly calling the shared library. So how do I get the static library "stuff" into the shared library so that it can be used indirectly by the JVM via JNI?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2002 12:35 AM
04-09-2002 12:35 AM
Re: Unresolved Symbol when calling C code via JNI
Dave,
are you trying to mix static and shared libraries (.sl and .a files)? aCC discourages that. Quote from aCC documentation:
NOTE: To maintain compatibility on future releases, archive and shared libraries should not be mixed. Refer to the "Mixing Shared and Archive Libraries" section in the HP-UX Linker and libraries Online User Guide.
Regards, Martin
are you trying to mix static and shared libraries (.sl and .a files)? aCC discourages that. Quote from aCC documentation:
NOTE: To maintain compatibility on future releases, archive and shared libraries should not be mixed. Refer to the "Mixing Shared and Archive Libraries" section in the HP-UX Linker and libraries Online User Guide.
Regards, Martin
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP