美文网首页
编译Jsoncpp静态库

编译Jsoncpp静态库

作者: 禄眠 | 来源:发表于2021-02-27 14:35 被阅读0次

简介

最近事情比较多,好久没写博客了,现在回头补一补

开始

  1. 下载Jsoncpp源码以及编译脚本
git clone https://github.com/open-source-parsers/jsoncpp.git

git clone https://github.com/allanmax/a_jsoncpp_android.git

将下载的jsoncpp源码放到a_jsoncpp_android

如果需要支持低版本设备,比如Android 4.4(19),则要在jni/Application.mk添加以下内容

APP_PLATFORM := android-19
  1. 编译jsoncpp

    cd a_jsoncpp_android
    
    ndk-build
    

    如果出现以下提示:

    APP_STL gnustl_shared is no longer supported. Please switch to either c++_static or c++_shared. See https://developer.android.com/ndk/guides/cpp-support.html for more information.
    

    则修改jni/Application.mk,将gnustl_shared改成c++_static即可

    输出的文件在obj/local目录下

相关文章

网友评论

      本文标题:编译Jsoncpp静态库

      本文链接:https://www.haomeiwen.com/subject/asqifltx.html