From: Doan V. D. <vie...@ya...> - 2011-06-24 20:49:37
|
Yes, I was able to load the library. The problem happens when I start to call the class constructor (or any other method) Thanks VDung ________________________________ From: Daniel Blezek <Ble...@ma...> To: Doan Viet Dung <vie...@ya...>; "swi...@li..." <swi...@li...> Sent: Friday, June 24, 2011 8:40 PM Subject: Re: [Swig-user] UnsatisfiedLinkError problem (sorry for re-posting this) Re: [Swig-user] UnsatisfiedLinkError problem (sorry for re-posting this) Hi, Were you able to sucessfully load the library into the JVM? Something like: System.loadLibrary ( “example” ); or System.load ( “example.dll” ); I’m not as familiar with Windows... Best, -dan On 6/24/11 11:01 AM, "Doan Viet Dung" <vie...@ya...> wrote: Hi, > >My apology for this post cause I knew this must have been posted before. I've taken a look on the manual and also the mailing lists however I've found no clear answer. > >This is a very popular problem (dynamic link problem C++ and Java). >I used the java example named class in swig package on window xp and mingw. Here is what I've done (I learnt from here >http://www.dabeaz.com/cgi-bin/wiki.pl?SwigFaqDLLUsingMingw) > >swig -c++ -java example.i (ok this done, i got a wrapper file and the java files) >g++ -c example.cxx example_wrap.cxx -I/c/tcl/include -I/c/java/include -I/c/java/include/win32 (ok, i got the o.file) >g++ -shared example.o example_wrap.o -L/c/tcl/lib -o example.dll (ok, i got the dll) >javac *.java >java runme > >and here is the error > >Creating some objects: >Exception in thread "main" java.lang.UnsatisfiedLinkError: exampleJNI.new_Circle(D)J > at exampleJNI.new_Circle(Native Method) > at Circle.<init>(Circle.java:38) > at runme.main(runme.java:19) > >As you mentioned in the manual that : make sure you pass all of the required libraries to the linker. I dont know what I missed here. Please can anyone clearfy what are the required libraries do we need (on window) ??? >Thank you very much for your help. > >Best regards >VDung > > > > >>________________________________ >------------------------------------------------------------------------------ >All the data continuously generated in your IT infrastructure contains a >definitive record of customers, application performance, security >threats, fraudulent activity and more. Splunk takes this data and makes >sense of it. Business sense. IT sense. Common sense.. >http://p.sf.net/sfu/splunk-d2d-c1 >>________________________________ >_______________________________________________ >Swig-user mailing list >Swi...@li... >https://lists.sourceforge.net/lists/listinfo/swig-user > -- Daniel Blezek, PhD Medical Imaging Informatics Innovation Center P 127 or (77) 8 8886 T 507 538 8886 E ble...@ma... Mayo Clinic 200 First St. S.W. Harwick SL-44 Rochester, MN 55905 mayoclinic.org "It is more complicated than you think." -- RFC 1925 |