Hi, I wrote JNI sample code. Try this.
import jnim
import dynlib
proc Java_HelloJNI_hello*(env: JNIEnvPtr, me:jobject, arg:jstring ):
jstring {.cdecl,exportc,dynlib.} =
if theEnv == nil :
{.emit: """
NimMain();
""".}
theEnv = env
var argNim:cstring = env.GetStringUTFChars(env,arg,nil)
defer:
env.ReleaseStringUTFChars(env,arg,argNim)
var ss = "Hello " & $argNim
return env.NewStringUTF(env,ss)
- How to compile a shared library for JNI? bluenote
- Re: How to compile a shared library for JNI? Krux02
- Re: How to compile a shared library for JNI? bluenote
- Re: How to compile a shared library for JNI? Araq
- Re: How to compile a shared library for JNI? Krux02
- Re: How to compile a shared library for JNI... bluenote
- Re: How to compile a shared library for... 6in
- Re: How to compile a shared library... bluenote
- Re: How to compile a shared library... Krux02
- Re: How to compile a shared library... bluenote
- Re: How to compile a shared library... Krux02
- Re: How to compile a shared library... bluenote
- Re: How to compile a shared library... Krux02
- Re: How to compile a shared library... bluenote
- Re: How to compile a shared library... Araq
