我正在尝试为pjsip for android构建so文件。 按照此链接中提到的步骤操作后 https://trac.pjsip.org/repos/wiki/Getting-Started/Android 我能够成功构建,直到这些步骤。
$ ./configure-android
$ make dep && make clean && make
在尝试构建示例pjsua2应用程序时,它会抛出此错误。
Makefile importsym.py java pjsua2.i python symbols.i symbols.lst Warning **: file symbols.i is out of date. Run make symbol.
for dir in java; do \
if make -C $dir all; then \
true; \
else \
exit 1; \
fi; \
done
make[1]: Entering directory '/home/protocol/Jeeva/PJSIPWorks/AESEncryption/pjsip-apps/src/swig/java'
mkdir -p android/app/src/main/jniLibs/armeabi
/home/protocol/Jeeva/Android/android-ndk-r13b/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-g++ -shared -o android/app/src/main/jniLibs/armeabi/libpjsua2.so output/pjsua2_wrap.o \
-DPJ_AUTOCONF=1 -fpic -ffunction-sections -funwind-tables -no-canonical-prefixes -g -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=softfp -mthumb -Os -DNDEBUG -Ijni -DANDROID -Wa,--noexecstack -Wformat -Werror=format-security -isystem /home/protocol/Jeeva/Android/android-ndk-r13b/platforms/android-19/arch-arm/usr/include -I/home/protocol/Jeeva/Android/android-ndk-r13b/sources/cxx-stl/gnu-libstdc++/4.9/include -I/home/protocol/Jeeva/Android/android-ndk-r13b/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a/include -DPJ_IS_BIG_ENDIAN=0 -DPJ_IS_LITTLE_ENDIAN=1 -I/home/protocol/Jeeva/PJSIPWorks/openssl-1.0.2l/include -I/home/protocol/Jeeva/PJSIPWorks/AESEncryption/pjlib/include -I/home/protocol/Jeeva/PJSIPWorks/AESEncryption/pjlib-util/include -I/home/protocol/Jeeva/PJSIPWorks/AESEncryption/pjnath/include -I/home/protocol/Jeeva/PJSIPWorks/AESEncryption/pjmedia/include -I/home/protocol/Jeeva/PJSIPWorks/AESEncryption/pjsip/include -fPIC -D__ANDROID__ -L/home/protocol/Jeeva/PJSIPWorks/AESEncryption/pjlib/lib -L/home/protocol/Jeeva/PJSIPWorks/AESEncryption/pjlib-util/lib -L/home/protocol/Jeeva/PJSIPWorks/AESEncryption/pjnath/lib -L/home/protocol/Jeeva/PJSIPWorks/AESEncryption/pjmedia/lib -L/home/protocol/Jeeva/PJSIPWorks/AESEncryption/pjsip/lib -L/home/protocol/Jeeva/PJSIPWorks/AESEncryption/third_party/lib --sysroot=/home/protocol/Jeeva/Android/android-ndk-r13b/platforms/android-19/arch-arm -L/home/protocol/Jeeva/Android/android-ndk-r13b/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a/ -L/home/protocol/Jeeva/PJSIPWorks/openssl-1.0.2l/lib -lpjsua2-arm-unknown-linux-androideabi -lstdc++ -lpjsua-arm-unknown-linux-androideabi -lpjsip-ua-arm-unknown-linux-androideabi -lpjsip-simple-arm-unknown-linux-androideabi -lpjsip-arm-unknown-linux-androideabi -lpjmedia-codec-arm-unknown-linux-androideabi -lpjmedia-arm-unknown-linux-androideabi -lpjmedia-videodev-arm-unknown-linux-androideabi -lpjmedia-audiodev-arm-unknown-linux-androideabi -lpjmedia-arm-unknown-linux-androideabi -lpjnath-arm-unknown-linux-androideabi -lpjlib-util-arm-unknown-linux-androideabi -lsrtp-arm-unknown-linux-androideabi -lresample-arm-unknown-linux-androideabi -lg729codec-arm-unknown-linux-androideabi -lgsmcodec-arm-unknown-linux-androideabi -lspeex-arm-unknown-linux-androideabi -lilbccodec-arm-unknown-linux-androideabi -lg7221codec-arm-unknown-linux-androideabi -lyuv-arm-unknown-linux-androideabi -lwebrtc-arm-unknown-linux-androideabi -lpj-arm-unknown-linux-androideabi -lssl -lcrypto -lm -lgnustl_static -lc -lgcc -ldl -lOpenSLES -llog -lGLESv2 -lEGL -landroid -Wl,-soname,libpjsua2.so
/home/protocol/Jeeva/Android/android-ndk-r13b/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: error: output/pjsua2_wrap.o: incompatible target
collect2: error: ld returned 1 exit status
Makefile:165: recipe for target 'android/app/src/main/jniLibs/armeabi/libpjsua2.so' failed
make[1]: *** [android/app/src/main/jniLibs/armeabi/libpjsua2.so] Error 1
make[1]: Leaving directory '/home/protocol/Jeeva/PJSIPWorks/AESEncryption/pjsip-apps/src/swig/java'
Makefile:23: recipe for target 'all' failed
make: *** [all] Error 1
error: output/pjsua2_wrap.o: incompatible target
看到这个后,我尝试通过删除此特定文件并允许它从脚本再次重新创建来解决此问题。 在此路径中删除此文件pjsua2_wrap.o后修复了问题
pjsip-apps/src/swig/java/output/pjsua2_wrap.o
删除此文件后,此问题已得到解决。