linphone-android for mac編譯過程記錄

本文記錄linphone-andoroid在mac上的編譯過程,在這裏做下記錄,希望對大家有所幫助,如有疑問發評論即可:

環境搭建:

JAVA_HOME=$(/usr/libexec/java_home)
ANDROID_HOME=/Users/mydocument/Library/Android/sdk
ANDROID_NDK=/Users/mydocument/Library/Android/android-ndk-r14b

PATH=$PATH:$JAVA_HOME/bin:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools:$ANDROID_NDK
export JAVA_HOME ANDROID_HOME ANDROID_NDK

編譯過程中碰到的問題:

1. 找不到 R.raw.rootca:

報錯信息:
/Users/mydocument/Documents/xing/AndroidStudioProjects/linphone-android/src/android/org/linphone/LinphoneManager.java:908: 錯誤: 找不到符號
                copyFromPackage(R.raw.rootca, new File(mLinphoneRootCaFile).getName());

問題處理:由於rootca是通過網絡下載的,所以造成報錯的原因是未編譯完成,即未走到下載流程,檢查網絡是否正常和其他報錯信息即可;

2. Could not find the pkg-config program:

報錯信息:
-- Using configuration file '/Users/mydocument/Documents/xing/AndroidStudioProjects/linphone-android/submodules/cmake-builder/configs/config-android.cmake'
-- Found PythonInterp: /usr/bin/python (found version "2.7.10")
CMake Error at cmake/CheckBuildTools.cmake:147 (message):
  Could not find the pkg-config program.
Call Stack (most recent call first):
  builders/CMakeLists.txt:72 (include)
  configs/config-android.cmake:71 (include)
  CMakeLists.txt:64 (include)`

問題處理:安裝:pkg-config:brew install pkg-config
報錯信息:
CMake Error at CMakeLists.txt:638 (add_library):
  Cannot find source file:

    celt/bands.c

  Tried extensions .c .C .c++ .cc .cpp .cxx .m .M .mm .h .hh .h++ .hm .hpp
  .hxx .in .txx


CMake Error: Cannot determine link language for target "opus".
CMake Error: CMake can not determine linker language for target: opus
-- Generating done
CMake Warning:
  Manually-specified variables were not used by the project:

    ENABLE_SHARED


-- Build files have been written to: /Users/mydocument/Documents/xing/AndroidStudioProjects/linphone-android/WORK/android-arm64/Build/opus
make[3]: *** [/Users/mydocument/Documents/xing/AndroidStudioProjects/linphone-android/WORK/android-arm64/Stamp/EP_opus/EP_opus-configure] Error 1
make[2]: *** [CMakeFiles/EP_opus.dir/all] Error 2
make[1]: *** [all] Error 2
make: *** [arm64-build] Error 2

問題處理:刪除目錄->submodules/externals/opus,同步代碼:git submodule sync && git submodule update --init --recursive
報錯信息:
CMake Error at CMakeLists.txt:309 (add_library):
  Cannot find source file:

    amrwb/wrapper.cpp

  Tried extensions .c .C .c++ .cc .cpp .cxx .m .M .mm .h .hh .h++ .hm .hpp
  .hxx .in .txx


CMake Error at CMakeLists.txt:217 (add_library):
  Cannot find source file:

    amrnb/wrapper.cpp

  Tried extensions .c .C .c++ .cc .cpp .cxx .m .M .mm .h .hh .h++ .hm .hpp
  .hxx .in .txx


CMake Error: Cannot determine link language for target "opencore-amrwb".
CMake Error: CMake can not determine linker language for target: opencore-amrwb
CMake Error: Cannot determine link language for target "opencore-amrnb".
CMake Error: CMake can not determine linker language for target: opencore-amrnb
-- Generating done
-- Build files have been written to: /Users/mydocument/Documents/xing/AndroidStudioProjects/linphone-android/WORK/android-arm64/Build/opencoreamr
make[3]: *** [/Users/mydocument/Documents/xing/AndroidStudioProjects/linphone-android/WORK/android-arm64/Stamp/EP_opencoreamr/EP_opencoreamr-configure] Error 1
make[2]: *** [CMakeFiles/EP_opencoreamr.dir/all] Error 2
make[1]: *** [all] Error 2
make: *** [arm64-build] Error 2

問題處理:同問題3一樣,刪除目錄->submodules/externals/opencore-amr,同步代碼:git submodule sync && git submodule update --init --recursive

5. /bin/sh: yasm: command not found

報錯信息:
/bin/sh: yasm: command not found
make[5]: *** [vpx_ports/emms.asm.o] Error 127
make[4]: *** [.DEFAULT] Error 2
make[3]: *** [/Users/mydocument/Documents/xing/AndroidStudioProjects/linphone-android/WORK/android-x86/Stamp/EP_vpx/EP_vpx-build] Error 2
make[2]: *** [CMakeFiles/EP_vpx.dir/all] Error 2
make[1]: *** [all] Error 2
make: *** [x86-build] Error 2

問題處理:安裝yasm:brew install yasm

6. cpuid.asm:196: error: symbol `XGETBV’ redefined

../../../..//submodules/externals/openh264/codec/common/x86/cpuid.asm:196: error: symbol `XGETBV' redefined
make[4]: *** [codec/common/x86/cpuid.o] Error 1
make[3]: *** [/Users/mydocument/Documents/xing/AndroidStudioProjects/linphone-android/WORK/android-x86/Stamp/EP_openh264/EP_openh264-build] Error 2
make[2]: *** [CMakeFiles/EP_openh264.dir/all] Error 2
make[1]: *** [all] Error 2
make: *** [x86-build] Error 2

問題處理:安裝nasm: brew install nasm

歡迎關注微信公衆號

微信公衆號

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章