Error While building PJSiP in Android

做~自己de王妃 提交于 2020-01-04 02:39:08

问题


When i tried to put this command while building pjsip for android,

TARGET_ABI=armeabi-v7a ./configure-android --use-ndk-cflags

This error occured,

compiler not found, please check environment settings (TARGET_ABI, etc)

can somebody give me an explanation.pls


回答1:


I'm sure you've moved on past this by now, but for anyone else who finds this thread:

Just set the NDK_TOOLCHAIN_VERSION environment variable to 4.9

This can be done either by doing an export prior to the configure call:

export NDK_TOOLCHAIN_VERSION=4.9
./configure-android

or on the same command line as the configure call:

NDK_TOOLCHAIN_VERSION=4.9 TARGET_ABI=<whatever> ./configure-android --use-ndk-cflags

In revision 13+ of the android NDK, the default compiler is Clang instead of GCC. PJSIP 2.6 (newest as of this writing) is not yet updated to parse for the Clang compiler location correctly, so it claims "compiler not found, please check environment settings". Setting the NDK_TOOLCHAIN_VERSION to 4.9 forces the NDK to use GCC in place of Clang, and then PJSIP will be happy.

According to the NDK revision history, GCC will be removed in a future release. So if someone reading this is using a version of the NDK where it's been removed (which hasn't happened yet at the time of this writing), you'll need to just downgrade your NDK.

This solution comes from this answer and the corresponding PJSIP ticket can be found here.




回答2:


GCC support has been stopped and has been replaced by Clang.

Try this:

export CC="$ANDROID_NDK/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang -target armv7-none-linux-androideabi -gcc-toolchain $NDK_TOOLCHAIN"

export CXX="$ANDROID_NDK/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++ -target armv7-none-linux-androideabi -gcc-toolchain $NDK_TOOLCHAIN"


来源:https://stackoverflow.com/questions/40594699/error-while-building-pjsip-in-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!