Android NDK - 在哪里放置在LOCAL_SHARED_LIBRARIES中指定的.so文件?

时间:2013-05-10 02:14:49

标签: android-ndk makefile

我已经成功构建了libcurl for android作为共享库,包括armeabi-v7a和x86,我的一个项目依赖于它。我设置了“LOCAL_SHARED_LIBRARIES:= libcurl”,问题是我应该把那些libcurl.so文件放在哪里?

我尝试将它们放在(project)/ jni / lib /(platform)/libcurl.so下,而ndk-build给了我一大堆链接错误。 (project)/ lib /(platform)/llcurl.so也不会工作,因为ndk-build会在构建之前清除这个目录。

所以我再次尝试,一次建立1个平台,但我仍然不知道在哪里放置它。 jni / libcurl.so将无效。

1 个答案:

答案 0 :(得分:1)

简单,按照此方法,从http://curl.haxx.se/下载curl源

  - prepare the toolchain of the Android NDK for standalone use; this can
    be done by invoking the script:

    ./build/tools/make-standalone-toolchain.sh
    which creates a usual cross-compile toolchain. Lets assume that you put
    this toolchain below /opt then invoke configure with something like:

    export PATH=/opt/arm-linux-androideabi-4.4.3/bin:$PATH

    ./configure --host=arm-linux-androideabi [more configure options]

    make

完成。