定制自己的交叉编译工具链
NDK=/usr/local/src/Android/Sdk/ndk-bundle
随便写个小程序test.cpp
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <string>
#include <map>
int main(){
std::string s = "hello";
std::map<std::string, std::string> kv;
kv["name"] = "2";
std::cout << "name=" << kv["name"] << std::endl;
return 0;
}
编译
/usr/local/src/Android/my-android-toolchain/bin/arm-linux-androideabi-g++ -o test test.cpp -static
上传文件
adb push test /data/chenhf
测试
使用ARM DS-5
加入工具链
创建工程,选择arm-linux-androideabi
参考资料
https://developer.android.google.cn/ndk/guides/standalone_toolchain.html