By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,554 Members | 1,146 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,554 IT Pros & Developers. It's quick & easy.

UnsatisfiedLinkException with jni but for a function I don't use !

P: n/a
Hello !

I'm trying to use JBits and XHWIF to program a FPGA with java. I must
implement in c the interface between java and the board and I must
make a dynamic library callable from a java program.

My problem is following :
I have four files : custom.c, custom.h, customJNI.c, customJNI.h
customJNI.c include customJNI.h and custom.h
customJNI.h include jni.h
custom.c include custom.h

I compile the file customJNI.c to make a dynamic library for linux :
gcc -fpic -shared -O2 -s -Wall -Wno-unused -Wno-parentheses
-Wreturn-type -I. -I/usr/admxrc2-1_1_0/include -DLINUX
-I/usr/java/j2sdk1.4.1/include -I/usr/java/j2sdk1.4.1/include/linux
-I/usr/admxrc2-1_1_0/include -L/usr/admxrc2-1_1_0/library -ladmxrc2
/usr/admxrc2-1_1_0/apps/common.o -lpthread -o libCustomJNI.so
customJNI.c
Up to now all is well. Then I do in my java code
loadLibrary("CustomJNI");
Then I type java -Djava.library.path="location of my library" MyProg
and I've got the following error :
Could not load library CustomJNI
UnsatisfiedLinkException: java.lang.UnsatisfiedLinkError:
/home/vonhalle/Desktop/JBits3/bin/libCustomJNI.so:
/home/vonhalle/Desktop/JBits3/bin/libCustomJNI.so: undefined symbol:
strlwr

I understant the error, but I don't use strlwr in all my files!
How is it possible ?

Thank you, sorry for my english, regards

Barthélémy von Haller
Jul 17 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.