• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

UnsatisfiedLinkError -- Missing underscore in _Java prefix?

 
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I'm getting the familiar JNI error UnsatisfiedLinkError. In my particular case, the code works fine on Linux, but I get that dreaded error on Windows. I suspect its something to do with the build options. I'm using MinGW to build.

I compile with options like this:
g++ -ggdb -c -U_WIN32 -D_JNI_IMPLEMENTATION_ -Wall TestUtilities.cpp

and link like this:
g++ -shared -D_JNI_IMPLEMENTATION_ -Wl --kill-at --add-stdcall-alias -o JNI_API.dll TestUtilities.o Manager.o -lstdc++ -lws2_32

Finally, a DLL export viewer shows my function names beginning with "Java_", but I believe when I used to build this under VisualStudio, the names began with "_Java".

Any ideas?
 
John Kelty
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, it seems like this may have been a stumper. I found a hack around it, by defining this macro:



and using it like this:



--John
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic