libjpeg-turbo for android

前端 未结 4 544
予麋鹿
予麋鹿 2020-11-27 12:35

I need libjpeg-turbo for android ndk. Did anyone managed to compile it as .a (static) lib? I have tried a few times, but it gave me a lot of errors only.

4条回答
  •  伪装坚强ぢ
    2020-11-27 12:52

    For anyone trying to build the official repo version, I had success using the patch attached here: libjpeg-turbo cross-compile to Android fails.

    Then, depending on whether you're compiling for 32-bit or 64-bit:

    export CFLAGS="-DSIZEOF_SIZE_T=4"
    

    or

    export CFLAGS="-DSIZEOF_SIZE_T=4"
    

    And run cmake with -DWITH_SIMD=FALSE -DCMAKE_TOOLCHAIN_FILE=your_toolchain_file.

    Of course, I'm aware that disabling SIMD is not ideal, but at least I managed to get a build I can start using. Hopefully, the buildsystem's NEON SIMD support will get fixed, in the future. Using ./configure also failed to build the correct SIMD for ARM.

    Incidentally, I wish folks would contribute fixes to the main repo, rather than simply forking it. It's been 2 years since the last change to the repo cited in alex-cohn's answer.

提交回复
热议问题