1

我正在使用 android-ndk-r9

当我尝试编译 pjsua android 示例http://goo.gl/sg621z时,出现以下错误:

Android NDK: WARNING:jni/Android.mk:pjsua: non-system libraries in linker flags: -    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-videodev-arm-unknown-linux-androideabi -lpjmedia-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 -lresample-arm-unknown-linux-androideabi -lmilenage-arm-unknown-linux-androideabi -lsrtp-arm-unknown-linux-androideabi -lgsmcodec-arm-unknown-linux-androideabi -lspeex-arm-unknown-linux-androideabi -lilbccodec-arm-unknown-linux-androideabi -lg7221codec-arm-unknown-linux-androideabi -lpj-arm-unknown-linux-androideabi -lgcc -lgcc    
This is likely to result in incorrect builds. Try using LOCAL_STATIC_LIBRARIES or LOCAL_SHARED_LIBRARIES instead to list the library dependencies of the    
current module    
Invoking SWIG...
swig -c++ -o jni/pjsua_wrap.cpp -package org.pjsip.pjsua -outdir src/org/pjsip/pjsua -java jni/pjsua.i
Compile++ thumb  : pjsua <= pjsua_wrap.cpp
SharedLibrary  : libpjsua.so
arm-linux-androideabi-g++: error: /home/hadi/Development/pjproject/pjsip-    apps/build/output/pjsua-arm-unknown-linux-androideabi/pjsua_app.o: No such file or directory
arm-linux-androideabi-g++: error: /home/hadi/Development/pjproject/pjsip-apps/build/output/pjsua-arm-unknown-linux-androideabi/pjsua_app_cli.o: No such file or directory
arm-linux-androideabi-g++: error: /home/hadi/Development/pjproject/pjsip-apps/build/output/pjsua-arm-unknown-linux-androideabi/pjsua_app_common.o: No such file or directory
arm-linux-androideabi-g++: error: /home/hadi/Development/pjproject/pjsip-apps/build/output/pjsua-arm-unknown-linux-androideabi/pjsua_app_config.o: No such file or directory
arm-linux-androideabi-g++: error: /home/hadi/Development/pjproject/pjsip-apps/build/output/pjsua-arm-unknown-linux-androideabi/pjsua_app_legacy.o: No such file or directory
make: *** [obj/local/armeabi/libpjsua.so] Error 1

这是示例附带的默认 Android.mk

# $Id$

LOCAL_PATH  := $(call my-dir)
include $(CLEAR_VARS)

# Get PJ build settings
include ../../../../build.mak
include $(PJDIR)/build/common.mak

# Path to SWIG
MY_SWIG     := swig

MY_MODULE_PATH  := $(PJDIR)/pjsip-apps/build/output/pjsua-$(TARGET_NAME)
MY_MODULES      := $(MY_MODULE_PATH)/pjsua_app.o \
           $(MY_MODULE_PATH)/pjsua_app_cli.o \
           $(MY_MODULE_PATH)/pjsua_app_common.o \
           $(MY_MODULE_PATH)/pjsua_app_config.o \
           $(MY_MODULE_PATH)/pjsua_app_legacy.o

# Constants
MY_JNI_WRAP := pjsua_wrap.cpp
MY_JNI_DIR  := jni

# Android build settings
LOCAL_MODULE    := libpjsua
LOCAL_CFLAGS    := -Werror $(APP_CFLAGS) -frtti
LOCAL_LDFLAGS   := $(APP_LDFLAGS)
LOCAL_LDLIBS    := $(MY_MODULES) $(APP_LDLIBS)
LOCAL_SRC_FILES := $(MY_JNI_WRAP) pjsua_app_callback.cpp

# Invoke SWIG
$(MY_JNI_DIR)/$(MY_JNI_WRAP):
    @echo "Invoking SWIG..."
    $(MY_SWIG) -c++ -o $(MY_JNI_DIR)/$(MY_JNI_WRAP) -package org.pjsip.pjsua -outdir src/org/pjsip/pjsua -java $(MY_JNI_DIR)/pjsua.i

.PHONY: $(MY_JNI_DIR)/$(MY_JNI_WRAP)

include $(BUILD_SHARED_LIBRARY)
4

1 回答 1

3

在执行 ndk-build 命令之前,请执行以下步骤

cd pjsip-apps/build 制作 pjsua

然后在 /pjsip-apps/src/pjsua/android 目录下执行 ndk-build

看看下面的博客

http://srikayala.wordpress.com/2013/12/05/pjsip-for-android-installation-on-mac-osx-mavericks/

了解更多信息

于 2013-12-05T08:46:22.043 回答