pjsua2 on ios Library not found for -lssl - ios

Getting pjsip user agent sample project working
I have compiled the libraries for pjsip here:
pjsip ios
I have gotten android to work and I am trying to get the xcode project running for the user agent. I have compiled it against openssl. I added the user agent library and the openssl libraries to the library folder. Once done, I have one error left that I cannot seem to solve:
Showing All Errors Only
Library not found for -lssl
I am getting this even when I do not use or build against the openssl options
my openssl libs are: libcrypto.a and libssl.a once those are added, my error count goes from 111 to one. This is my first ios project so I was wondering if I missed a step adding the references.

has nothing to do with whether ssl is enabled. Some of the libraries use openssl so the project needed header and library paths. Copied the OpenSSL output I already had to the project, and it built fine
Found the answer here: Wai Ha Lee answered it.
add open ssl

Related

How does one build a OpenSSL library for Project Catalyst?

I have to support OpenSSL in my project in building my iPad app for UIKitForMac. Currently, I get these errors.
Building for UIKit for Mac, but the linked library 'libssl.a' was built for freestanding. You may need to restrict the platforms for which this library should be linked in the target editor.
Building for UIKit for Mac, but the linked library 'libcrypto.a' was built for freestanding. You may need to restrict the platforms for which this library should be linked in the target editor.
I was reading about XCFrameworks, but Apple really hasn't put out much information here. Has anyone figured out build scenarios?
The solution in the comments doesn't work for me. However, I just build to different libs: iOS as I used to and another one for Catalyst by adding the build parameters: -target x86_64-apple-ios13.0-macabi and defining Mac SDK in -isysroot. After that, I just conditionally add each of the libraries for each build version and it works.
Amid mounting frustration following many failed attempts and Google searches, I successfully built openSSL 1.1.1g for Catalyst, compiled my project, linked openSSL and launched the app on my Mac by doing the following:
I used the same directory in to which I had previously extracted and built openSSL for IOS.
Following instructions here, I edited <openSSL directory>/Configurations/10-main.conf. Scrolling down to the "darwin64-x86_64-cc" section, I added a second CFLAGS line:
CFLAGS => add("-target x86_64-apple-ios13.0-macabi"),
In the openSSL directory, execute ./Configure darwin64-x86_64-cc -shared Note that I've seen several other versions of this Configure statement, some with many more options. This command worked for me, but I'm not sure what all the other variations do. You may want to research this further.
Execute make clean to clear all the objects from the prior IOS build
Execute make This successfully built openSSL.
In Xcode, under -> General -> "Frameworks, Libraries and Embedded Content" I removed both libcrypto.a and libssl.a this was a critical step
Switching tabs to Build Phases -> Link Binary With Libraries, verify both archives are removed from this section as well. (It appeared that removing them in step 5 also cleared them in step 6, but I'm not certain).
Back on General -> Frameworks, click the + to add new entries, select "add other" in the lower left corner of the popup window, then provide the path to the newly built libcrypto.a. Repeat for libssl.a
Delete the derived data in a terminal window (I'm not certain this was necessary, but did it out of an abundance of caution):
cd ~/Library/Developer/Xcode
mv DerivedData DerivedData.old
Build the project in Xcode. This successfully completed.
Steps 5-7 turned out to be critical. Even though I moved and/or completely replaced the prior libraries, when I tried to build in Xcode I would get linker errors that I was building for MacOS Catalina but trying to link something built for MacOS x86.

Xcode9 beta - Error adding openssl & library not found for -lcrypto

I am trying to add open SSL universal via cocoapods, it's installing it but on terminal, I am getting this message
The CustomerApp [Debug] target overrides the LIBRARY_SEARCH_PATHS
build setting defined in Pods/Target Support
Files/Pods-CustomerApp/Pods-CustomerApp.debug.xcconfig. This can lead
to problems with the CocoaPods installation
- Use the $(inherited) flag, or
- Remove the build settings from the target
another problem is in XCode (9 beta) build failed with this error
library not found for -lcrypto..
I am really dying because of this, have tried everything possible but no success I tried manually adding OpenSSL by downloading from site and setting the path in build settings by doing that it doesn't show error but in my swift file when import OpenSSL it says no such module.
please help me!
I think it is looking for libcrypto.a library, can you search through your project see if it exists. When you download the OpenSSL library, it should have the library along with a bundle of header files.

Embed OpenSSL module in Swift framework so its not needed when importing into application [duplicate]

I have installed OpenSSL in xcode for receipt validation, but it doesn't work.
I download openssl.xcodeproj and openssl-1.0.1f. I extract openssl-1.0.1f and add openssl.xcodeproj to my project.
I edit the Header Search Path to :
/Users/marko/Documents/Razvoj/BIView\ Mobile\ New\ Version/openssl/include/openssl
I added libcrypto.a in Target Dependencies under Build Phases
and added libcrypto.a in Link Binary With Libraries
as was described in http://atastypixel.com/blog/easy-inclusion-of-openssl-into-iphone-app-projects/.
But when I build project it stops with error :
clang: error: no such file or directory: '/Users/ .... -bmgslnakszsfovecplbzoslykrxo/Build/Products/Debug-iphoneos/libcrypto.a'
Why ?
OK, how to build and install it....
It might be easier to use a pre-built version of OpenSSL for iOS. You can find one at this Github account. The OpenSSL from that Github are multi-arch. They have ARMv7, ARMv7s, ARM64, and i386. That means they work with devices and simulators.
Download either OpenSSL 1.0.1e or 1.0.1f. Install it in a location like /usr/local/ssl/ios.
Then, add the headers to your Xcode project. They are located in /usr/local/ssl/ios/include:
Finally, add the multi-arch libs (libcrypto.a and libssl.a) to your Xcode project. They are located in /usr/local/ssl/ios/lib:
You need to add the library as a Framework. See this question: how to add an existing framework in Xcode 5.
Its OK to add the OpenSSL libraries under Frameworks. Its how things are done under Apple/Xcode.
I use the Absolute Path like in the image below because Crypto++, OpenSSL, etc are installed in /usr/local. The image below is a screen capture I have handy of Crypto++, and not OpenSSL's libcrypto.a or libssl.a. But the same applies to all libraries.

Installing OpenSSL library for Xcode

I have installed OpenSSL in xcode for receipt validation, but it doesn't work.
I download openssl.xcodeproj and openssl-1.0.1f. I extract openssl-1.0.1f and add openssl.xcodeproj to my project.
I edit the Header Search Path to :
/Users/marko/Documents/Razvoj/BIView\ Mobile\ New\ Version/openssl/include/openssl
I added libcrypto.a in Target Dependencies under Build Phases
and added libcrypto.a in Link Binary With Libraries
as was described in http://atastypixel.com/blog/easy-inclusion-of-openssl-into-iphone-app-projects/.
But when I build project it stops with error :
clang: error: no such file or directory: '/Users/ .... -bmgslnakszsfovecplbzoslykrxo/Build/Products/Debug-iphoneos/libcrypto.a'
Why ?
OK, how to build and install it....
It might be easier to use a pre-built version of OpenSSL for iOS. You can find one at this Github account. The OpenSSL from that Github are multi-arch. They have ARMv7, ARMv7s, ARM64, and i386. That means they work with devices and simulators.
Download either OpenSSL 1.0.1e or 1.0.1f. Install it in a location like /usr/local/ssl/ios.
Then, add the headers to your Xcode project. They are located in /usr/local/ssl/ios/include:
Finally, add the multi-arch libs (libcrypto.a and libssl.a) to your Xcode project. They are located in /usr/local/ssl/ios/lib:
You need to add the library as a Framework. See this question: how to add an existing framework in Xcode 5.
Its OK to add the OpenSSL libraries under Frameworks. Its how things are done under Apple/Xcode.
I use the Absolute Path like in the image below because Crypto++, OpenSSL, etc are installed in /usr/local. The image below is a screen capture I have handy of Crypto++, and not OpenSSL's libcrypto.a or libssl.a. But the same applies to all libraries.

library not found for lcrypto

I'm trying to build the iOS AllJoyn project, but I'm having trouble with the OpenSSL integration.
I've been looking at these directions: https://allseenalliance.org/docs-and-downloads/documentation/configuring-build-environment-ios-and-osx#unique_16
I've followed the directions all the way up to Xcode IDE Build, but now I'm getting an error that says: "library not found for lcrypto".
Looking online it looks like there might be something to do with the Makefile, but I'm not really sure what lcrypto is and what library I'm supposed to be referencing.
EDIT
I noticed that it says it is a Shell Script Invocation Error
Also here is the trace:
ld: warning: directory not found for option '-L/PATH/alljoyn/alljoyn/common/crypto/openssl/build/Debug-iphoneos'
ld: library not found for -lcrypto
clang: error: linker command failed with exit code 1 (use -v to see invocation)
scons: *** [build/darwin/arm/iphoneos/debug/obj/test/bbcclient] Error 1
scons: building terminated because of errors.
Command /usr/local/bin/scons failed with exit code 2
In order to successfully use the AllJoyn SDK you need to have a compiled version of the openssl library available (i.e. libcrypto.a).
The details to build the openssl library can be found in the README-INSTALLING.txt file under /alljoyn_objc in the SDK, I have copied the relevant instructions below. Once you have created the openssl library you need to place it in a directory accessible to your project (in your case "/PATH/alljoyn/alljoyn/common/crypto/openssl/build/Debug-iphoneos").
Most of this information is contained in the AllJoyn Programming Guide for Objective-C
Relevant text from the README-INSTALLING.txt file:
OpenSSL is required for iOS development and is available at the following web
address: www.openssl.org
AllJoyn has been tested with version 1.0.1 of OpenSSL.
Download the Xcode project that can be used to build OpenSSL for iOS from GitHub,
at the following web address: https://github.com/sqlcipher/openssl-xcode/
Installation
Copy the OpenSSL source into a separate folder on your development system, not
under the AllJoyn SDK.
Navigate to the OpenSSL source top folder in Finder, and copy the openssl.xcodeproj
folder you downloaded from GitHub into this folder.
Open the openssl.xcodeproj in Xcode.
In Xcode, build the crypto target (libssl.a and libcrypto.a) for each
combination of configuration (debug|release) and platform (iphoneos|iphonesimulator) that you
need for your iOS project by selecting Product->Build For->(your desired configuration).

Resources