library not found for lcrypto - ios

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).

Related

Unable to cross compile iOS programs on linux

I know that someone already asked this question but it isn`t up to date anymore. Most of the links are dead and the commands are not relevant anymore.
I have read these
Compile IOS program from linux commandline
How to cross-compile clang/llvm for iOS?
For example, I have been trying to compile silversearcher-ag for my iPhone 6 (jailbroken). This is the project link https://github.com/ggreer/the_silver_searcher.
I am targeting iOS 12.4.
These are the commands that I`ve tried
./configure CC=/home/growtopiajaw/Desktop/cctools-port-master/usage_examples/ios_toolchain/target/bin/arm-apple-darwin11-clang CXX=/home/growtopiajaw/Desktop/cctools-port-master/usage_examples/ios_toolchain/target/bin/arm-apple-darwin11-clang++ --host=arm-apple-darwin11
make
I am using cctools-port to cross compile the project. My compiled cctools toolchain is located under /home/growtopiajaw/Desktop/cctools-port-master/usage_examples/ios_toolchain/target and below is how the toolchain`s directory structure looks like
This is my configure log: https://del.dog/nugibonury
This is my make log:
CC src/ignore.o
In file included from src/ignore.c:11:
./src/options.h:7:10: fatal error: 'pcre.h' file not found
#include <pcre.h>
^~~~~~~~
1 error generated.
make: *** [Makefile:494: src/ignore.o] Error 1
This is my GitHub repository containing the cross compile toolchain
https://github.com/GrowtopiaJaw/arm-apple-darwin11
Apple does not ship PCRE. You need to get the headers and dylib/tbd files manually.
If you're using checkra1n or unc0ver, then the deb on the APT repo contains headers as well, so you could just use that.
If you plan to package this into an APT/dpkg file, make sure to add pcre as a dependency.

pjsua2 on ios Library not found for -lssl

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

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.

Static library and cocoapods with Xcode 6.1.1 - ld: library not found Error

Not sure it is related to Xcode 6.1.1 or Cocoapods 0.35.0.
I have generated new static iOS library with Xcode 6.1.1.
SUCCESS (without cocoapods)
Generate simulator and Device library
Lipo to both and generate FAT MyLib.a static final lib
Create new View Application project. (I haven't changed any default setting. e.g. Base SDK, Valid Architecture.)
Add MyLib.a and necessary header files to application project manually.
Build the app project and IT WORKS FINE !! NO ERROR NO WARNING.
ERROR
Upload same MyLib.a & headers (generated above) to HTTP direct download server(kind of artifact server).
Generate specs & podfile.
Remove all dependency (lib and header) from app project which i have done manually earlier.
Add pod file and local specs
"Pod install" command pull out MyLib.a and header properly in /Pods folder.
But while building the app project gives me
Ld Build/Products/Debug-iphonesimulator/LibTest.app/LibTest normal x86_64
cd /Users/admin/Cocoapods/Project/Library/TestProject/LibTest
export IPHONEOS_DEPLOYMENT_TARGET=8.1
ld: library not found for -lMyLib
clang: error: linker command failed with exit code 1 (use -v to see invocation)
When i fire "lipo" command on MyLib.a
Architectures in the fat file: /Users/admin/Cocoapods/Project/Library/Libs/Final/MyLib.a are: armv7 armv7s i386 x86_64 arm64
Its not really architecture issue otherwise it should get failed in my first attempt which doesn't have cocoapods. Cocoapods does some build configuration changes and that creates this issue.
Help me to resolve this issue.
After spending 2 days to figure out the exact issue, i found very silly fix. Its basically issue with static library naming convention issue.
If you have static library in artifact/media http server and wanted to integrate with Cococapods, make sure library name should be lib(your name).a along with headers.
In my case i have kept MyLib and it got dowloaded currently while "pod install" but during app building it was failing.
After renaming to libMyLib.a, every thing works for me. :)
Very easy to apply yet difficult to find such solution]
Not sure whether cocoapods has documented this in there any guide or not.

Linker error building project with Facebook SDK

I just added the latest Facebook SDK code from Github to my project. Because I'm using ARC, I used their supplied shell script to build the static library. I added it to my project and made sure the static library is being linked, but I'm receiving this linker error:
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_FBFrictionlessRequestSettings", referenced from:
objc-class-ref in libfacebook_ios_sdk.a(Facebook.o)
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Here are the linker settings:
Any ideas?
The head revision has some recent changes that seem to have broken ARC builds (static library). The static library builds ok, but then when used in my project I get the linker errors. What I did to fix the problem was to revert to the previous version of the Facebook sdk and these linker errors went away.
See https://github.com/facebook/facebook-ios-sdk/commits/master
I used the version checked in on the 24th Feb (not 25th Feb, sorry Jason Clark!)
https://github.com/facebook/facebook-ios-sdk/tree/9acf74345bb248d698966eac9a3057a4b4be1b0f
The Feb 25th commit has FBFrictionlessRequestSettings.m missing from the xcode project so it is not included in the static link library eventhough the header is.
1.- Clone the latest repo, at the time of this post the latest commit is: https://github.com/facebook/facebook-ios-sdk/commit/4e3567c40e3b7f8156a82f18e5a2f5cd18e077eb
2.- Open the xcode project facebook-ios-sdk.xcodeproj under the src directory
3.- Add FBFrictionlessRequestSettings.m under FBConnect.
4.- Using the project Navigator, make suer FBFrictionlessRequestSettings.m is listed in build phases under compile sources
5.- Save and close xcode project
6.- Run scripts/build_facebook_ios_sdk_static_lib.sh to build most recent static linked library and follow installation instructions, you should be able to compile and link your project without any issues.
Better yet, clone this repo and build it. All ready to go https://github.com/alvarezm50/facebook-ios-sdk
Looks like something whent wrong when building your fb-ios-sdk … Everything up2date and there were no errors when building the static lib?
I have no problems getting the latest version of the SDK up & running in the simulator or on my iOS5 device.
Here's what I did (OS X 10.7.3, Xcode 4.2.1, iOS5 ARC)
Grab the lastest source files: https://github.com/facebook/facebook-ios-sdk/zipball/master
Unzip files & build it cd ~/facebook-ios-sdk/scripts/ && ./build_facebook_ios_sdk_static_lib.sh
Now grab the facebook-ios-sdk folder inside ~/facebook-ios-sdk/lib/, put into your Xcode project foler like this: http://cl.ly/1X3B203f272z2l0w2t39 & link against libfacebook_ios_sdk.a in Xcode
Add ${SOURCE_ROOT}/facebook-ios-sdk to your Header Search Paths
I have tried this procedure and able to fix it.
Select Your project Target -> build phases ->compile Sources
add all the .m files from facebook static library also json static library.
Now if you run the app it wont throw any linker errors.
I had the same issue. It turned out to be fairly trivial. I do use XCode's support for git, preferring to use the command line. However, this means that I need to make sure that every time I pull from git I also add any new files and remove all deleted files. In this case, FBFrictionlessRequestSettings.* did the trick.
File->Add Files to "My Project"
This has been fixed in master as of 2/27. Please pull the master and that should take care of this issue.
https://github.com/facebook/facebook-ios-sdk/commit/e10bdc15b31ab23b229f1f3e77b0e8d7affe60af
Thanks!

Resources