summaryrefslogtreecommitdiff
path: root/Doc/Manual/Java.html
diff options
context:
space:
mode:
authorWilliam S Fulton <wsf@fultondesigns.co.uk>2009-08-08 23:29:08 +0000
committerWilliam S Fulton <wsf@fultondesigns.co.uk>2009-08-08 23:29:08 +0000
commit46a258a748dd56d5a04fb3614ee28a27869060c7 (patch)
tree64cceb24b4b113ed527f4171e2d4f39b9d4ffefd /Doc/Manual/Java.html
parent136bd5175af2864ac32ded708e3f0ba7c249ed66 (diff)
downloadswig-46a258a748dd56d5a04fb3614ee28a27869060c7.tar.gz
Add another common cause for getting an UnsatisfiedLinkError
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11519 626c5289-ae23-0410-ae9c-e8d60b6d4f22
Diffstat (limited to 'Doc/Manual/Java.html')
-rw-r--r--Doc/Manual/Java.html13
1 files changed, 13 insertions, 0 deletions
diff --git a/Doc/Manual/Java.html b/Doc/Manual/Java.html
index 2cde5ddab..fc5646c10 100644
--- a/Doc/Manual/Java.html
+++ b/Doc/Manual/Java.html
@@ -447,6 +447,19 @@ $
<p>
This error usually indicates that you forgot to include some object files or libraries in the linking of the native library file.
Make sure you compile both the SWIG wrapper file and the code you are wrapping into the native library file.
+If you forget to compile and link in the SWIG wrapper file into your native library file, you will get a message similar to the following:
+</p>
+
+<div class="code"><pre>
+$ java runme
+Exception in thread "main" java.lang.UnsatisfiedLinkError: exampleJNI.gcd(II)I
+ at exampleJNI.gcd(Native Method)
+ at example.gcd(example.java:12)
+ at runme.main(runme.java:18)
+</pre></div>
+
+<p>
+where <tt>gcd</tt> is the missing JNI function that SWIG generated into the wrapper file.
Also make sure you pass all of the required libraries to the linker.
The <tt>java -verbose:jni</tt> commandline switch is also a great way to get more information on unresolved symbols.
One last piece of advice is to beware of the common faux pas of having more than one native library version in your path.