0

我正在尝试为具有 openssl 支持的 IOS 模拟器构建 PJSIP 库。
我按照此链接中提到的说明
https://trac.pjsip.org/repos/wiki/Getting-Started/iPhone
PJSIP 网站指向 Openssl wiki 安装和说明页面以获取指导。

所以为我的 iPhone 模拟器构建 openssl 这些是我给出的命令。

export CC="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/../../../Toolchains/XcodeDefault.xctoolchain/usr/bin/clang"
KERNEL_BITS=64  ./Configure darwin64-x86_64-cc no-shared no-dso no-hw no-engine --prefix=$HOME/ssl
make depend
make
make install_sw


在此之后,我可以看到 openssl 似乎在我在命令中提到的文件夹路径中的终端中构建没有任何错误或警告。所以要仔细检查,我在libssl.a文件
上使用这个命令

lipo -info libssl.a 
Non-fat file: libssl.a is architecture: x86_64


看到lib文件构建成功,我似乎很高兴。

现在下一步是将其与 pjsip 库构建链接。
我按照 pjsip 网站中提到的步骤进行操作。
这些是我输入终端的命令

export DEVPATH=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer
    ARCH="-arch x86_64" CFLAGS="-O2 -m64 -mios-simulator-version-min=5.0" LDFLAGS="-O2 -m64 -mios-simulator-version-min=5.0" ./configure-iphone  --with-ssl=/Users/nexgetech01/ssl 
    make dep && make

如pjsip网站中所述,我可以看到我新构建的openssl库已成功链接并通过终端中的pjsip命令进行了测试

checking for OpenSSL installations..
Using SSL prefix... /Users/nexgetech01/ssl
checking openssl/ssl.h usability... yes
checking openssl/ssl.h presence... no
aconfigure: WARNING: openssl/ssl.h: accepted by the compiler, rejected by the preprocessor!
aconfigure: WARNING: openssl/ssl.h: proceeding with the compiler's result
checking for openssl/ssl.h... yes
checking for ERR_load_BIO_strings in -lcrypto... yes
checking for SSL_CTX_new in -lssl... yes
OpenSSL library found, SSL support enabled


所以一切似乎都太好了,继续这个过程。但是编译结束时我遇到了这个错误

    Undefined symbols for architecture x86_64:
  "_opendir$INODE64", referenced from:
      _OPENSSL_DIR_read in libcrypto.a(o_dir.o)
  "_readdir$INODE64", referenced from:
      _OPENSSL_DIR_read in libcrypto.a(o_dir.o)
ld: symbol(s) not found for architecture x86_64


因此,为了确保这一点,我在libcrypto.a的终端上使用了以下命令

    nm -A libcrypto.a |grep OPENSSL_DIR_rea
libcrypto.a:o_dir.o: 0000000000000000 T _OPENSSL_DIR_read

我可以在我的 libcrypto.ai 中找到未定义的内容,不知道我在构建 openssl 库时缺少什么?我坚持构建这个 openssl 库一个星期。请指导我,以便我可以解决这个问题。

4

0 回答 0