-
-
[求助]想通过dlsym(),调用libdvm.so中的dvmDecodeIndirectRef()函数,不知该如何声明函数形变量?
-
发表于:
2014-9-28 11:49
15846
-
[求助]想通过dlsym(),调用libdvm.so中的dvmDecodeIndirectRef()函数,不知该如何声明函数形变量?
想通过dlopen()及dlsym(),动态加载libdvm.so库,并调用其中的dvmDecodeIndirectRef()函数。
在android源代码中找到 dvmDecodeIndirectRef函数定义如下:
Object* dvmDecodeIndirectRef(Thread* self, jobject jobj);
在自己的.CPP程序中定义函数形变量:
typedef Object* PObject;
typedef PObject (*PMETH_dvmDecodeIndirectRef)(Thread* self, jobject jobj);
PMETH_dvmDecodeIndirectRef meth_dvmDecodeIndirectRef;
代码执行时情况如下:
void *ldvm = (void*)dlopen("libdvm.so", RTLD_LAZY); <<<<<<<ldvm 值能正常得到
meth_dvmDecodeIndirectRef = (PMETH_dvmDecodeIndirectRef)dlsym(ldvm, "dvmDecodeIndirectRef"); <<<<<meth_dvmDecodeIndirectRef值为0
并未取得该函数指针,不明白是哪里的问题?是定义部分错了吗?
谢谢!
[注意]传递专业知识、拓宽行业人脉——看雪讲师团队等你加入!