我有一个android程序,它的主要逻辑是用NDK编写的。但现在我想评估一些python代码作为主逻辑的一部分。所以我尝试在chttp://docs.python.org/2/extending/embedding.html中使用这个嵌入python
我用这样的native.c创建了一个简单的android项目(我所做的只是添加python头)#include
#include
#include
#include
#include
#define DEBUG_TAG "NDK_AndroidNDK1SampleActivity"
void Java_com_example_com_test_mytest_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);
}
这是我的安卓.mk在
^{pr2}$
编译(使用Mac)时出现以下错误Compile thumb : ndk1 <= native.c
arm-linux-androideabi-gcc: error: i386: No such file or directory
arm-linux-androideabi-gcc: error: x86_64: No such file or directory
arm-linux-androideabi-gcc: error: unrecognized option '-arch'
arm-linux-androideabi-gcc: error: unrecognized option '-arch'
make: *** [obj/local/armeabi/objs/ndk1/native.o] Error 1
有人能帮忙吗?:天