I have two libraries, one with Ada objects and one with C ++ objects (I don't have much control over what happens)
Ada's material refers to material C and vice versa ...
This symbol is located in libIPCAda.so: ipc_manager_shutdown_c
This symbol is in libIPCC.so: stream_buffer_header_size
When I make these JNA calls:
CLibrary INSTANCE8 = (CLibrary) Native.loadLibrary("IPCAda", // <<< our library goes here CLibrary.class); CLibrary INSTANCE9 = (CLibrary) Native.loadLibrary("IPCC", // <<< our library goes here CLibrary.class);
I get this:
ld.so.1: java: fatal: relocation error: file <<my directory>>/lib/libIPCAda.so: symbol stream_buffer_header_size: referenced symbol not found
When I make these JNA calls:
CLibrary INSTANCE9 = (CLibrary) Native.loadLibrary("IPCC", // <<< our library goes here CLibrary.class); CLibrary INSTANCE8 = (CLibrary) Native.loadLibrary("IPCAda", // <<< our library goes here CLibrary.class);
I get this:
Exception in thread "main" java.lang.UnsatisfiedLinkError: Unable to load library 'IPCC': ld.so.1: java: fatal: relocation error: file <<my directory>>/lib/libIPCC.so: symbol ipc_manager_shutdown_c: referenced symbol not found at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:163) at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:236) at com.sun.jna.Library$Handler.<init>(Library.java:140) at com.sun.jna.Native.loadLibrary(Native.java:379) at com.sun.jna.Native.loadLibrary(Native.java:364) at Test2$CLibrary.<clinit>(Test2.java:55) at Test2.main(Test2.java:74)
Obviously, he doesn't like the cross-shaped characters ... Is there a way to make this work in JNA?
* IMAGE Compilation example *
gcc -c -fPIC -g -O0 -fstack-check -pipe -gnatE -gnatU -gnatwl -gnatf -gnatE -gnat05 -lIPCC -I- -gnatA <<my directory>>src/ndds_c.adb
systemoutprintln
source share