日期:2014-05-20  浏览次数:20743 次

c语言连接错误(java运用jni 的时候),求指点,急啊
jobjectArray rowArray = ((*env)->GetObjectArrayElement(env, arrayStringData, i));
jobject idObj=((*env)->GetObjectArrayElement(env,rowArray,0));
jobject nameObj=((*env)->GetObjectArrayElement(env,rowArray,1));
jobject amountObj=((*env)->GetObjectArrayElement(env,rowArray,2));
jobject priceObj=((*env)->GetObjectArrayElement(env,rowArray,3));
char* idPointer=GetCharArrayElements(env,idObj,NULL);
char* namePointer=GetCharArrayElements(env,nameObj,NULL);
int *amountPointer=GetIntArrayElements(env,amountObj,NULL);
double* pricePointer=GetDoubleArrayElements(env,priceObj,NULL);
strcmp(id,idPointer);
strcmp(name,namePointer);
amount= *amountPointer;
price=*pricePointer;
ReleaseCharArrayElements(env,idObj,idPointer,0);
ReleaseCharArrayElements(env,nameObj,namePointer,0);
ReleaseIntArrayElements(env,amountObj,amountPointer,0);
ReleaseDoubleArrayElements(env,priceObj,pricePointer,0);



--------------------Configuration: 01 - Win32 Debug--------------------
Linking...
Creating library Debug/01.lib and object Debug/01.exp
01.OBJ : error LNK2001: unresolved external symbol _ReleaseDoubleArrayElements
01.OBJ : error LNK2001: unresolved external symbol _ReleaseIntArrayElements
01.OBJ : error LNK2001: unresolved external symbol _ReleaseCharArrayElements
01.OBJ : error LNK2001: unresolved external symbol _GetDoubleArrayElements
01.OBJ : error LNK2001: unresolved external symbol _GetIntArrayElements
01.OBJ : error LNK2001: unresolved external symbol _GetCharArrayElements
Debug/01.exe : fatal error LNK1120: 6 unresolved externals
Error executing link.exe.
01.exe - 7 error(s), 0 warning(s)

------解决方案--------------------
链接出错啊,_ReleaseDoubleArrayElements,_ReleaseIntArrayElements等等的函数符号表中找不到,你看看这些函数的头文件有没有被包含进去.