android嵌入python_在android NDK中嵌入python

我有一个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

有人能帮忙吗?:天

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值