User forums > Using Code::Blocks
Compiling a JNI file in Dev-C++ and Code::Blocks
kostyabkg:
Hello!
When I compile a hello.DLL file as it says in JNI tutorial on Java web-site:
http://java.sun.com/docs/books/tutorial/native1.1/stepbystep/index.html, it gives me an unsatisfied linker error. But when I do the same thing in Dev-C++ everything works fine. Also a DLL file produced by Dev-C++ is about 1 KB bigger. There is probably one little check box I need to tick, but I have no idea where this check box is and where to look for it.
Thank you!
Michael:
Hello,
Could you post with the link error you get (the C::B build Log)?
Michael
kostyabkg:
I am sorry for being not clear enough. I get this error when I launch the java file. I just followed the tutorial in both cases, but the file compiled by Dev-C++ run correctly while being invoked by my java program, whereas when my java program is trying to invoke the DLL file created by Code::Blocks it gives me this error:
Exception in thread "main" java.lang.UnsatisfiedLinkError: displayHelloWorld
at HelloWorld.displayHelloWorld(Native Method)
at HelloWorld.main(HelloWorld.java:9)
In this java trail it says about an error, but the error they quote there is a little different from the one I get. It just seems to me that this file somehow doesn't "interact" with my Java program, but what the problem? I don't have a clue... And why Dev-C++ works?
Michael:
Ok. Thanks for the explanation.
I have reproduced the same error by following the JNI tutorial. I will try to check what is wrong.
Michael
Michael:
That's interesting. If I use the MS Toolkit 2003 compiler all works fine. But with GNU GCC... :?.
Michael
Navigation
[0] Message Index
[#] Next page
Go to full version