2
votes

While Integrating Latest OpenSSL Library with PJSIP gives following error.

Compiling Openssl 1.1.0f with PJSIP using following command.

./configure-iphone --with-ssl=/Users/nexgetech01/Downloads/OpenSSL-for-iPhone-master/bin/iPhoneOS10.3-armv7.sdk/

It gives successful compilation with openssl and gives ready to make the build.

After that I build the OpenSSL library with PJSIP using following command.

make dep && make clean && make

while building it gives me following error.

Undefined symbols for architecture armv7:
  "_SSL_library_init", referenced from:
      _init_openssl in libpj-armv7-apple-darwin_ios.a(ssl_sock_ossl.o)
  "_SSL_load_error_strings", referenced from:
      _init_openssl in libpj-armv7-apple-darwin_ios.a(ssl_sock_ossl.o)
  "_TLSv1_method", referenced from:
      _create_ssl in libpj-armv7-apple-darwin_ios.a(ssl_sock_ossl.o)
  "_TLSv1_server_method", referenced from:
      _init_openssl in libpj-armv7-apple-darwin_ios.a(ssl_sock_ossl.o)
  "_X509_get_notAfter", referenced from:
      _get_cert_info in libpj-armv7-apple-darwin_ios.a(ssl_sock_ossl.o)
  "_X509_get_notBefore", referenced from:
      _get_cert_info in libpj-armv7-apple-darwin_ios.a(ssl_sock_ossl.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/pjlib-test-armv7-apple-darwin_ios] Error 1
make[1]: *** [pjlib-test-armv7-apple-darwin_ios] Error 2
make: *** [all] Error 1
1

1 Answers

2
votes

After checking the PJSIP tickets, this bug was fixed by PJSIP developers. I will show, how to fix the above error easier.

Please open the ssl_sock_ossl.c file in following path,

$(PJSIP_DIR)/pjlib/src/pj/ssl_sock_ossl.c

Follow the below PJSIP link to overwrite ssl_sock_ossl.c file.

Add the green coloured lines correctly in your ssl_sock_ossl.c using following link.

https://trac.pjsip.org/repos/changeset/5623

https://trac.pjsip.org/repos/ticket/1999