ndk-build を使用して非常に単純なネイティブ関数を構築しようとすると、次のエラーが発生します。
DriverAdapter.cpp:6:69: error: expected ',' or '...' before 'this'
以下は私の .mk と .cpp ファイルです
DriverAdapter.cpp
#include <jni.h>
#include <string.h>
#include <android/log.h>
#define DEBUG_TAG "NDK_AndroidNDK1SampleActivity"
void Java_com_ihearhtpi_MainActivity_helloLog(JNIEnv * env, jobject this, jstring logThis)
{
jboolean isCopy;
const char * szLogThis = (*env)->GetStringUTFChars(env, logThis, &isCopy);
__android_log_print(ANDROID_LOG_DEBUG, DEBUG_TAG, "NDK:LC: [%s]", szLogThis);
(*env)->ReleaseStringUTFChars(env, logThis, szLogThis);
}
Android.mk
LOCAL_PATH := $(my-dir を呼び出す)
include $(call all-subdir-makefiles)
include $(CLEAR_VARS)
LOCAL_LDLIBS := -llog
LOCAL_MODULE :=driver
LOCAL_SRC_FILES :=DriverAdapter.cpp
include $(BUILD_SHARED_LIBRARY)
なぜこれが起こっているのか分かりません。