2013-05-10 52 views
0

我已經成功爲android構建libcurl作爲共享庫,armeabi-v7a和x86,以及我的一個項目都依賴於它。我設置了「LOCAL_SHARED_LIBRARIES:= libcurl」,問題是我應該在哪裏放置這些libcurl.so文件?我嘗試把它們放在(project)/ jni/lib /(platform)/libcurl.so下,而且ndk-build會給我一個鏈接錯誤的負擔。 (project)/ lib /(platform)/libcurl.so將不起作用,因爲ndk-build會在構建之前清除此目錄。Android NDK - 在哪裏放置LOCAL_SHARED_LIBRARIES中指定的.so文件?

所以我再次嘗試,一次構建1個平臺,但我仍然不知道該把它放在哪裏。 jni/libcurl.so將不起作用。

回答

1

簡單,按照此,從http://curl.haxx.se/

- 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 

完成下載捲曲源。