Java_Sendtobank_send(JNIEnv *env, jobject obj,jstring whattosend)
{
const jbyte *str =(const jbyte *)env->GetStringUTFChars(whattosend,JNI_FALSE);
printf("Hello,%s\n",str);
env->ReleaseStringUTFChars(whattosend,str);
return;
}
出错:
/home/oracle/Sendtobank.c: In function `Java_Sendtobank_send':
/home/oracle/Sendtobank.c:9: request for member `GetStringUTFChars' in something not a structure or union
/home/oracle/Sendtobank.c:11:
怎么解决啊?
代码原来是用在C++的,我现在用在c,会不会是这个原因呢? 如果是的话应该怎么改?
4 个解决方案
#1
问题解决
#2
还可以用
wchar_t* cstr=(wchar_t*)(*env).GetStringChars(jstr,NULL);
int size=(*env).GetStringLength(jstr);
wchar_t* cstr=(wchar_t*)(*env).GetStringChars(jstr,NULL);
int size=(*env).GetStringLength(jstr);
#3
楼上的兄弟,这个问题我是这么解决的:
http://expert.csdn.net/Expert/topic/2591/2591935.xml?temp=.474682
另请帮我看看:
http://expert.csdn.net/Expert/topic/2598/2598941.xml?temp=.6342127
http://expert.csdn.net/Expert/topic/2591/2591935.xml?temp=.474682
另请帮我看看:
http://expert.csdn.net/Expert/topic/2598/2598941.xml?temp=.6342127
#4
结贴
#1
问题解决
#2
还可以用
wchar_t* cstr=(wchar_t*)(*env).GetStringChars(jstr,NULL);
int size=(*env).GetStringLength(jstr);
wchar_t* cstr=(wchar_t*)(*env).GetStringChars(jstr,NULL);
int size=(*env).GetStringLength(jstr);
#3
楼上的兄弟,这个问题我是这么解决的:
http://expert.csdn.net/Expert/topic/2591/2591935.xml?temp=.474682
另请帮我看看:
http://expert.csdn.net/Expert/topic/2598/2598941.xml?temp=.6342127
http://expert.csdn.net/Expert/topic/2591/2591935.xml?temp=.474682
另请帮我看看:
http://expert.csdn.net/Expert/topic/2598/2598941.xml?temp=.6342127
#4
结贴