Symbol in DLL begin with _

Pasch, Thomas (ACTGRO) extern.thomas.pasch@volkswagen.de
Mon Jul 30 02:49:00 GMT 2001


Hello, 

this is problably a beginner question. I want to create
DLLs for JNI with cygwin. I've read the messages and
tips about DLLs, wrote a script for making them and 
I think, I've succeeded.

But I've got a strange Problem. When I define a C function
Java_Stack_newStack in my source code I've got

$ nm Stack.dll | grep newStack
2000100c T _Java_Stack_newStack@8

well, the symbol '_Java_Stack_newStack' in the DLL. This is not 
what is expected from Java. The library is loaded
but

$ java Stack
Stack.main
Exception in thread "main" java.lang.UnsatisfiedLinkError: newStack
        at Stack.newStack(Native Method)
        at Stack.<init>(Stack.java:10)
        at Stack.main(Stack.java:27)

the native method 'newStack' (i.e. Java_Stack_newStack) is not 
found. 

I suspect that the leading '_' causes the problem. Is there a way to
get ride off it?

Regards,

Thomas



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/



More information about the Cygwin mailing list