0

I downloaded pjsip source code from online.It is running without any error.But, I integrated openssl lib and include file into that pjsip > ipjsua xcode project.After compiled xcode project, am getting library not found error and warning like below,

ld: warning: directory not found for option '-L"/Users/aahlaad/Desktop/swyxpjsip/iospj2/pjproject-2.2.1/pjsip-apps/src/pjsua/ios/../../../../pjlib/lib"'
ld: warning: directory not found for option '-L"/Users/aahlaad/Desktop/swyxpjsip/iospj2/pjproject-2.2.1/pjsip-apps/src/pjsua/ios/../../../../pjlib-util/lib"'
ld: warning: directory not found for option '-L"/Users/aahlaad/Desktop/swyxpjsip/iospj2/pjproject-2.2.1/pjsip-apps/src/pjsua/ios/../../../../pjmedia/lib"'
ld: warning: directory not found for option '-L"/Users/aahlaad/Desktop/swyxpjsip/iospj2/pjproject-2.2.1/pjsip-apps/src/pjsua/ios/../../../../pjnath/lib"'
ld: warning: directory not found for option '-L"/Users/aahlaad/Desktop/swyxpjsip/iospj2/pjproject-2.2.1/pjsip-apps/src/pjsua/ios/../../../../pjsip/lib"'
ld: warning: directory not found for option '-L"/Users/aahlaad/Desktop/swyxpjsip/iospj2/pjproject-2.2.1/pjsip-apps/src/pjsua/ios/../../../../third_party/lib"'
ld: library not found for -lpj-arm-apple-darwin9
clang: error: linker command failed with exit code 1 (use -v to see invocation)
jww
  • 97,681
  • 90
  • 411
  • 885
  • @jww No dupe. Ah this is duplicated no dupe :) Again, static libraries are different with frameworks, and needs an extra procedure. Also, library search path issue is mostly unrelated to frameworks. – eonil Jul 03 '14 at 06:36

2 Answers2

0

Delete your derived Data and Go to Project->Build Settings->Search Paths and remove everything from Framework/Header/Library Search Path respectively and add your frameworks again in Project -> General ->Linked Frameworks and Libraries

Archit
  • 1
  • 3
0

ld: library not found for -lpj-arm-apple-darwin9

Here's how to add headers and libraries under Xcode. Its shows how to add OpenSSL, but in your case, do the same for PJSIP.

Headers:

enter image description here

Libraries:

enter image description here

If your PJSIP library has both static archives and shared objects, then delete the shared objects. Even though iOS only allows static linking, Xcode will still link against a shared object if available. Apparently, the Xcode developers did not get the memo.


If you need help adding the PJSIP library to Xcode so it shows up under Frameworks and Libraries, then see How to “add existing frameworks” in Xcode 4?.


If you get the PJSIP library added but are missing architectures, you can use the following to see what's in the fat library:

$ xcrun -sdk iphoneos lipo -info /usr/local/ssl/ios/lib/libcrypto.a 
Architectures in the fat file: libcrypto.a are: armv7 armv7s arm64 i386 

Ideally, you will have the four architectures: ARMv7, ARMv7s, ARM64 and i386. i386 is for debug builds under the simulator.

If you are missing an architecture, then you should re-build the library with the missing architecture, and then use lipo to combine the different architectures into a single fat library.

Community
  • 1
  • 1
jww
  • 97,681
  • 90
  • 411
  • 885