【问题标题】:Can't link static lib for android NDK, cygwin gcc无法为 android NDK、cygwin gcc 链接静态库
【发布时间】:2012-11-02 14:58:00
【问题描述】:

我有PROJ4库,在cygwin下成功编译并安装到/usr/local。

我正在尝试编译为:

$ arm-linux-androideabi-gcc -o conftest -mthumb temp.c -lproj -L/usr/local/lib -lproj -lz -lm -ldl

C:/dev/Android/android-ndk-r7c/android-8-toolchain/bin/../lib/gcc/arm-linux-androideabi/4.4.3/../../../../arm-linux-androideabi/bin/ld.exe: cannot find -lproj collect2: ld returned 1 exit status

我做错了什么?

【问题讨论】:

    标签: gcc android-ndk cygwin linkage


    【解决方案1】:

    试试

    $ arm-linux-androideabi-gcc -o conftest -mthumb temp.c /usr/local/lib/libproj.a -lz -lm -ldl
    

    【讨论】:

      【解决方案2】:

      嗯,问题是android-gcc不理解cygwin路径,所以我们需要使用windows路径:

      $ arm-linux-androideabi-gcc -o conftest -mthumb temp.c -lproj -Lc:/path/to/lib -lproj -lz -lm -ldl

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2011-09-01
        • 2017-03-14
        • 2011-06-13
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多