为Xcode 4.3.2和SDK 5.1编译pjsip 2时出错

时间:2012-04-24 13:15:46

标签: iphone macos ios5 xcode4.3 pjsip

我正在尝试使用终端编译pjsip版本2,无论我尝试什么,我都会遇到不断的错误。一直在寻找互联网上的答案,包括stackoverflow。

我今天使用他们的subversion存储库下载了pjsip版本2,因此所有文件都应该是最新的。

按照本指南操作时:http://trac.pjsip.org/repos/wiki/Getting-Started/iPhone运行“make dep&& make clean&& make”后出现此错误:

ld: symbol(s) not found for architecture armv7
collect2: ld returned 1 exit status
make[2]: *** [../bin/pjsua-arm-apple-darwin9] Error 1
make[1]: *** [pjsua] Error 2
make: *** [all] Error 1

使用上述指南结合本指南时:http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/2011-October/013481.html运行“make dep&& make clean&& make”后出现此错误:

ld: symbol(s) not found for architecture arm
collect2: ld returned 1 exit status
make[2]: *** [../bin/pjsua-arm-apple-darwin10] Error 1
make[1]: *** [pjsua] Error 2
make: *** [all] Error 1

我在/pjlib/include/pj/config_site.h中包含以下代码:

#define PJ_CONFIG_IPHONE 1
#include <pj/config_site_sample.h>

如何在没有错误的情况下编译pjsip?

请考虑我是新手,谢谢!

1 个答案:

答案 0 :(得分:3)

从您的错误中,看起来可能有一些错误。我会确保在继续之前清除所有环境变量(为了安全起见)。

在./configure-iphone中,请确保更改:

./aconfigure --host=arm-apple-darwin9 --disable-floating-point $*

要:

./aconfigure --host=arm-apple-darwin10 --disable-floating-point $*

以下是我用来构建库的脚本:

模拟器:

    export DEVPATH=/Developer/Platforms/iPhoneSimulator.platform/Developer
    export CC=/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc

    export CFLAGS="-O2 -m32 -miphoneos-version-min=5.0 -g -ggdb -g3 -DNDEBUG" 
    export LDFLAGS="-O2 -m32"

    ./configure-iphone

    make clean
    make dep
    make
    make clean

设备:

  export ARCH="-arch armv7"
  export CFLAGS="-DNDEBUG -g -ggdb -g3"

  ./configure-iphone

  make clean
  make dep
  make
  make clean