Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add OpenSSL to an Xcode project

I am trying to port an application to mac OSX. It uses openssl. I am new to xcode and mac development. Do I need to compile and install openssl myself, or is there some equivalent of an openssl-devel package available as part of the OS or with homebrew or some such?

like image 778
Baruch Avatar asked Oct 26 '15 08:10

Baruch


1 Answers

  1. Download source from openssl source .
  2. Extract compressed file into directory of your choice. .
  3. Open command line and go to that directory and type something similar to ./configure darwin64-x86_64-cc .
  4. Then type make depend .
  5. Then make install .
  6. Go to your Xcode project build settings. Under Header Search Paths add /usr/local/ssl/include and library search paths /usr/local/ssl/lib (or whatever install paths you chose in the configure step) .
  7. Still in build settings go to Linking and under other linker flags put -lssl -lcrypto

You should be good to go now.

like image 108
annoying_squid Avatar answered Oct 21 '22 07:10

annoying_squid