Error:
Exception in thread "main" java.lang.UnsatisfiedLinkError: getOrder
at cppinterfacetest.Main.main(Main.java:24)
Files:
Main.java
JavaNativeHelloWorld.java
JavaNativeHelloWorld.h
JavaNativeHelloWorld.cpp
libjni_lib.so
Compiling:
C++ Lib
g++ JavaNativeHelloWorld.cpp -Wall -fPIC -I/usr/java14/include -shared -o libjni_lib.so
Java Main
java -cp . -Djava.library.path=. cppinterfacetest/Main
Running AIX Unix. Been trying to figure this out for a week. Here are results from nm libjni_lib.so
f -
.Java_JavaNativeHelloWorld_displayMesssage T 268435940
.Java_JavaNativeHelloWorld_getOrder T 268435832
._GLOBAL__DD T 268436904
._GLOBAL__DI T 268436824
._GLOBAL__FD_libjni_lib_so T 268436628
._GLOBAL__FI_libjni_lib_so T 268436432
.__deregister_frame_info T 268436224
.__deregister_frame_info t 268436224 40
.__register_frame_info_table T 268436184
.__register_frame_info_table t 268436184 40
.__strtollmax T 268435792
.__strtollmax t 268435792 40
.dereg_frame t 268436348
.puts T 268435752
.puts t 268435752 40
.reg_frame t 268436264
.strtoimax t 268436064
/tmp//ccChZRih.c f -
JavaNativeHelloWorld.cpp f -
Java_JavaNativeHelloWorld_displayMesssage D 536872744
Java_JavaNativeHelloWorld_displayMesssage d 536872744 12
Java_JavaNativeHelloWorld_getOrder D 536872732
Java_JavaNativeHelloWorld_getOrder d 536872732 12
LC..0 d 536872812 4
TOC d 536872804
_GLOBAL__FD_libjni_lib_so D 536872792
_GLOBAL__FD_libjni_lib_so d 536872792 12
_GLOBAL__FI_libjni_lib_so D 536872756
_GLOBAL__FI_libjni_lib_so d 536872756 12
_GLOBAL__F_Java_JavaNativeHelloWorld_displayMesssage_F658E2C4 D 536872456
_JavaNativeHelloWorld.rw_ t 268436984 13
__deregister_frame_info U -
__deregister_frame_info d 536872820 4
__gxx_personality_v0 U -
__register_frame_info_table U -
__register_frame_info_table d 536872816 4
__strtollmax U -
__strtollmax d 536872808 4
_ccChZRih.bss_ b 536872852 28
_ccChZRih.rw_ d 536872600 16
count d 536872832 4
ctors.1537 d 536872840 4
ctors.1537.P4 d 536872836 4
dereg_frame d 536872780 12
dtors.1550 d 536872844 4
dtors.1550.P4 d 536872848 4
frame_table d 536872824 4
glink.s f -
glink.s f -
glink.s f -
glink.s f -
ob.1532 d 536872828 4
puts U -
puts d 536872804 4
reg_frame d 536872768 12
Please help.
Exception in thread "main" java.lang.UnsatisfiedLinkError: getOrder
at cppinterfacetest.Main.main(Main.java:24)
Files:
Main.java
JavaNativeHelloWorld.java
JavaNativeHelloWorld.h
JavaNativeHelloWorld.cpp
libjni_lib.so
Compiling:
C++ Lib
g++ JavaNativeHelloWorld.cpp -Wall -fPIC -I/usr/java14/include -shared -o libjni_lib.so
Java Main
java -cp . -Djava.library.path=. cppinterfacetest/Main
Running AIX Unix. Been trying to figure this out for a week. Here are results from nm libjni_lib.so
f -
.Java_JavaNativeHelloWorld_displayMesssage T 268435940
.Java_JavaNativeHelloWorld_getOrder T 268435832
._GLOBAL__DD T 268436904
._GLOBAL__DI T 268436824
._GLOBAL__FD_libjni_lib_so T 268436628
._GLOBAL__FI_libjni_lib_so T 268436432
.__deregister_frame_info T 268436224
.__deregister_frame_info t 268436224 40
.__register_frame_info_table T 268436184
.__register_frame_info_table t 268436184 40
.__strtollmax T 268435792
.__strtollmax t 268435792 40
.dereg_frame t 268436348
.puts T 268435752
.puts t 268435752 40
.reg_frame t 268436264
.strtoimax t 268436064
/tmp//ccChZRih.c f -
JavaNativeHelloWorld.cpp f -
Java_JavaNativeHelloWorld_displayMesssage D 536872744
Java_JavaNativeHelloWorld_displayMesssage d 536872744 12
Java_JavaNativeHelloWorld_getOrder D 536872732
Java_JavaNativeHelloWorld_getOrder d 536872732 12
LC..0 d 536872812 4
TOC d 536872804
_GLOBAL__FD_libjni_lib_so D 536872792
_GLOBAL__FD_libjni_lib_so d 536872792 12
_GLOBAL__FI_libjni_lib_so D 536872756
_GLOBAL__FI_libjni_lib_so d 536872756 12
_GLOBAL__F_Java_JavaNativeHelloWorld_displayMesssage_F658E2C4 D 536872456
_JavaNativeHelloWorld.rw_ t 268436984 13
__deregister_frame_info U -
__deregister_frame_info d 536872820 4
__gxx_personality_v0 U -
__register_frame_info_table U -
__register_frame_info_table d 536872816 4
__strtollmax U -
__strtollmax d 536872808 4
_ccChZRih.bss_ b 536872852 28
_ccChZRih.rw_ d 536872600 16
count d 536872832 4
ctors.1537 d 536872840 4
ctors.1537.P4 d 536872836 4
dereg_frame d 536872780 12
dtors.1550 d 536872844 4
dtors.1550.P4 d 536872848 4
frame_table d 536872824 4
glink.s f -
glink.s f -
glink.s f -
glink.s f -
ob.1532 d 536872828 4
puts U -
puts d 536872804 4
reg_frame d 536872768 12
Please help.