我也使用NDK进行测试,我的代码是
extern "C" JNIEXPORT jint JNICALL
Java_com_xiangtianyu_sensorapplicationtest_sensortestcases_jnitest_
JniSensorTest_testCreateSharedMemoryDirectChannel1(JNIEnv
*env,jobjectinstance) {
// TODO
int fakeValidFd = 1;
return ASensorManager_createSharedMemoryDirectChannel(nullptr,
fakeValidFd, sizeof(ASensorEvent));}
我也使用
include <android/sensor.h>
但是当我创建项目时,出现此错误
error: undefined reference to 'ASensorManager_createSharedMemoryDirectChannel'
你能帮我吗?谢谢