How to use shared objects built from multiple source files with JNI?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Brian_Archer
Posted On:   Friday, September 7, 2001 04:02 PM

I have build a shared object using a single source file using the following: cc -G -I/usr/java1.2/include -I/usr/java1.2/include/solaris File1.cp p -o libSharedObject.so This works fine using JNI. I then built a shared object using 2 source files using the following: cc -G -I/usr/java1.2/include -I/usr/java1.2/include/solaris File1.cp p File2.cpp -o libSharedObject.so JNI now gives me the infamous UnsatisfiedLinkError exception. Has anyone ever successfully accomplished what I'm trying to do here? Thanks. Brian    More>>

I have build a shared object using a single source file using the following:

			
cc -G -I/usr/java1.2/include -I/usr/java1.2/include/solaris File1.cp
p -o libSharedObject.so


This works fine using JNI. I then built a shared object using 2 source files using the following:

			
cc -G -I/usr/java1.2/include -I/usr/java1.2/include/solaris File1.cp
p File2.cpp -o libSharedObject.so


JNI now gives me the infamous UnsatisfiedLinkError exception. Has anyone ever successfully accomplished what I'm trying to do here?


Thanks.
Brian

   <<Less

Re: How to use shared objects built from multiple source files with JNI?

Posted By:   Alexander_Krapf  
Posted On:   Saturday, September 8, 2001 07:40 AM

Brian,


Yes, we're doing that all the time. When a user generates C++ proxy classes using our JunC++ion tool, we also generate makefiles to build executables or shared libraries.


These projects regularly contain several dozens or even hundreds of source files and work just fine.


My guess is that you have a bug in File2.cpp and that your problem has nothing to do with the fact that you're using two files. Have you tried using just File2.cpp and dropping File1.cpp from the list?


Good luck,


Alex

About | Sitemap | Contact