Hi,
I am writing JNI application called MainPanel using Java, C++ and
a bit of C. It compiles and links without problem, but when I run
it, it crushes with the message:
prompt>java -green MainPanel pixelbuf
Exception in thread "main" java.lang.UnsatisfiedLinkError:
/homes/nikom/work/libStereoImageTransform.so:
undefined symbol: cout
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(Compiled Code)
at java.lang.ClassLoader.loadLibrary(Compiled Code)
at java.lang.Runtime.loadLibrary0(Compiled Code)
at java.lang.System.loadLibrary(Compiled Code)
at MainPanel.<clinit>(MainPanel.java:13)
make: *** [go] Error 1
Here is the code of MainPanel.java:
1 import java.awt.*;
2 import java.awt.event.*;
3 import javax.swing.*;
4
5 class MainPanel extends JPanel
6 {
7
8 public static synchronized native void
9 ImageTransform(int[] x1Array, int[] y1Array, int[]
x2Array, int[] y2Array);
10
11 static
12 {
--> 13 System.loadLibrary("StereoImageTransform");
14 }
15
16 static ImagePanel imagePanel;
17
......................................................
The structure of this JNI application is very simple:
+------------+
| Java code |
+------------+
| ^
v |
+------------+
| C wrapper |
+------------+
| ^
v |
+------------+
| C++ code |
+------------+
I always thought all symbols should be found (resolved) during the
linking stage. If there is no complains from the linker, there should
not be any complains during runtime. Looks like it is not so, but why?
Do you have any suggestions how to fix or investigate the problem?
Thank you,
Jacob Nikom
----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]