Android 编译错误:collect2: ld returned 1 exit status

        最近在编译Android 时,发现一错误:collect2: ld returned 1 exit status,上网搜索是链接库的问题,make clear 后重新make 也不可以,估计是编译链接顺序的问题,于是找到链接错误的库,并先模块编译这个库,然后再执行make编译,问题解决。

我遇到的错误如下:

target Executable: mediaserver (out/target/product/rk29sdk/obj/EXECUTABLES/mediaserver_intermediates/LINKED/mediaserver)
/home/eagle/project/rk2918-v210/gingerbread/prebuilt/linux-x86/toolchain/arm-eabi-4.5.4/bin/../lib/gcc/arm-eabi/4.5.4/../../../../arm-eabi/bin/ld: warning: librkswscale.so, needed by out/target/product/rk29sdk/obj/lib/libjpeghwenc.so, not found (try using -rpath or -rpath-link)
out/target/product/rk29sdk/obj/lib/libjpeghwenc.so: undefined reference to `sws_freeContext'
out/target/product/rk29sdk/obj/lib/libjpeghwenc.so: undefined reference to `sws_getContext'
out/target/product/rk29sdk/obj/lib/libjpeghwenc.so: undefined reference to `sws_scale'
collect2: ld returned 1 exit status
make: *** [out/target/product/rk29sdk/obj/EXECUTABLES/mediaserver_intermediates/LINKED/mediaserver] 错误 1


红色字体的库此时还没生成,于是搜索这个库并先模块编译(mmm external/libswscale/),然后执行make编译,问题解决。

你可能感兴趣的:(android,reference)