我是用iPhone制作pjsip的新手。我使用的是iOS 9.3.2,Xcode 7.3和Pjsip 2.5。我已经成功构建了没有g729的Pjsip 2.5,并且没有g729它工作正常。由于我的应用程序也需要g729,我遵循here的所有指令
在使用上述步骤启用g729之后,在“make dep && make clean && make”时,它为我的应用程序使用的所有体系结构提供了以下错误。
../src/pjsua2-test/main.cpp
if test ! -d ../bin; then mkdir -p ../bin; fi
/Applications/XCode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/../../../Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -o ../bin/pjsua2-test-armv7-apple-darwin_ios \
output/pjsua2-test-armv7-apple-darwin_ios/main.o -L/MyApps/pjproject/pjlib/lib -L/MyApps/pjproject/pjlib-util/lib -L/MyApps/pjproject/pjnath/lib -L/MyApps/pjproject/pjmedia/lib -L/MyApps/pjproject/pjsip/lib -L/MyApps/pjproject/third_party/lib -O2 -arch armv7 -isysroot /Applications/XCode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.3.sdk -framework AudioToolbox -framework Foundation -lpjsua2-armv7-apple-darwin_ios -lstdc++ -lpjsua-armv7-apple-darwin_ios -lpjsip-ua-armv7-apple-darwin_ios -lpjsip-simple-armv7-apple-darwin_ios -lpjsip-armv7-apple-darwin_ios -lpjmedia-codec-armv7-apple-darwin_ios -lpjmedia-armv7-apple-darwin_ios -lpjmedia-videodev-armv7-apple-darwin_ios -lpjmedia-audiodev-armv7-apple-darwin_ios -lpjmedia-armv7-apple-darwin_ios -lpjnath-armv7-apple-darwin_ios -lpjlib-util-armv7-apple-darwin_ios -lsrtp-armv7-apple-darwin_ios -lresample-armv7-apple-darwin_ios -lgsmcodec-armv7-apple-darwin_ios -lspeex-armv7-apple-darwin_ios -lilbccodec-armv7-apple-darwin_ios -lg7221codec-armv7-apple-darwin_ios -lpj-armv7-apple-darwin_ios -lm -lpthread -framework CoreAudio -framework CoreFoundation -framework AudioToolbox -framework CFNetwork -framework UIKit -framework UIKit -framework OpenGLES -framework AVFoundation -framework CoreGraphics -framework QuartzCore -framework CoreVideo -framework CoreMedia
Undefined symbols for architecture armv7:
"_pjmedia_codec_g729_init", referenced from:
_pjmedia_codec_register_audio_codecs in libpjmedia-codec-armv7-apple-darwin_ios.a(audio_codecs.o)
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [../bin/pjsua2-test-armv7-apple-darwin_ios] Error 1
make[1]: *** [pjsua2-test-armv7-apple-darwin_ios] Error 2
make: *** [all] Error 1
我真的被困在这里了。请帮我解决这个问题。任何人的一条线索都会有所帮助。
如果您正在关注您提到的链接,则无需进行任何修改。
export PJMEDIA_CODEC_OBJS += audio_codecs.o ffmpeg_vid_codecs.o openh264.o\
h263_packetizer.o h264_packetizer.o \
$(OS_OBJS) $(M_OBJS) $(CC_OBJS) $(HOST_OBJS) \
ipp_codecs.o silk.o opus.o $(CODEC_OBJS) \
g7221_sdp_match.o amr_sdp_match.o **g729.o**
export CFLAGS += -I$(THIRD_PARTY)/g729/**Headers**
-DPJMEDIA_HAS_G729_CODEC=1
(注意:请确保遵循makefile的规则,如果在任何情况下它都会给出任何错误。要确认,首先使用make命令构建third_party / build / g729 / Makefile。看看它是否成功,然后完整构建也将成功。)
include ../../../build.mak
include ../../../build/common.mak
export LIBDIR := ../../lib
RULES_MAK := $(PJDIR)/build/rules.mak
export G729_CODEC_LIB := libg729codec-$(TARGET_NAME)$(LIBEXT)
export _CFLAGS := $(CC_CFLAGS) $(OS_CFLAGS) $(HOST_CFLAGS) $(M_CFLAGS) \
$(CFLAGS) $(CC_INC)../.. $(CC_INC)../../g729/Headers \
$(CC_INC)../../../pjlib/include
export _CXXFLAGS:= $(_CFLAGS) $(CC_CXXFLAGS) $(OS_CXXFLAGS) $(M_CXXFLAGS) \
$(HOST_CXXFLAGS) $(CXXFLAGS)
export _LDFLAGS := $(CC_LDFLAGS) $(OS_LDFLAGS) $(M_LDFLAGS) $(HOST_LDFLAGS) \
$(LDFLAGS)
export G729_CODEC_SRCDIR = ../../g729
export G729_CODEC_OBJS = Sources/acelp_ca.o Sources/cod_ld8a.o Sources/dec_gain.o Sources/dspfunc.o Sources/g729a_encoder.o \
Sources/lpcfunc.o Sources/oper_32b.o Sources/post_pro.o Sources/pred_lt3.o Sources/tab_ld8a.o \
Sources/basic_op.o Sources/cor_func.o Sources/dec_lag3.o Sources/filter.o Sources/gainpred.o \
Sources/lspdec.o Sources/p_parity.o Sources/postfilt.o Sources/qua_gain.o Sources/taming.o \
Sources/bits.o Sources/de_acelp.o Sources/dec_ld8a.o Sources/g729a_decoder.o Sources/lpc.o \
Sources/lspgetq.o Sources/pitch_a.o Sources/pre_proc.o Sources/qua_lsp.o Sources/util.o
export G729_CODEC_CFLAGS = $(_CFLAGS)
TARGETS := $(G729_CODEC_LIB)
all: $(TARGETS)
doc:
cd .. && doxygen docs/doxygen.cfg
dep: depend
distclean: realclean
.PHONY: dep depend clean realclean distclean
.PHONY: $(TARGETS)
.PHONY: $(G729_CODEC_LIB)
libg729codec: $(G729_CODEC_LIB)
$(G729_CODEC_LIB):
$(MAKE) -f $(RULES_MAK) APP=G729_CODEC app=libg729codec $(subst /,$(HOST_PSEP),$(LIBDIR)/$@)
clean print_lib:
$(MAKE) -f $(RULES_MAK) APP=G729_CODEC app=libg729codec $@
realclean:
$(subst @@,$(subst /,$(HOST_PSEP),.libg729codec-$(TARGET_NAME).depend),$(HOST_RMR))
$(MAKE) -f $(RULES_MAK) APP=G729_CODEC app=libg729codec $@
depend:
$(MAKE) -f $(RULES_MAK) APP=G729_CODEC app=libg729codec $@