10

I am totally new to Obj-C, and trying to compile Big Number related Objective C files

The function was easy, just to initialize a big number and use NSLog to print it out.

I used

#import <openssl/bn.h>

but the xcode always displays me an error:

openssl/bn.h: No such file or directory.

I tried to find out if the .h file were missing, and typed locate in my terminal:

$ locate bn.h
/Developer/SDKs/MacOSX10.6.sdk/usr/include/openssl/bn.h
/usr/include/openssl/bn.h
/usr/local/texlive/2010/texmf-dist/tex/generic/hyph-utf8/patterns/txt/hyph-bn.hyp.txt

It seemed I have the bn.h file, but why the xcode kept me from compiling?

Thanks for any help!!

3 Answers 3

21

I had this exact problem, tried libcurl4-openssl-dev which didn't work, but found elsewhere that the following is the exact and proper solution:

sudo apt-get install libssl-dev

I'm working on a Raspberry Pi 3 running Jessie trying to compile hostapd, but I'm pretty sure the solution is generic across a wide range of distributions and projects, particularly if you swap apt-get for yum or other package manager.

1
  • 1
    While this command may answer the question, providing additional context regarding how and/or why it solves the problem would improve the answer's long-term value.
    – HiDeoo
    Jul 10, 2016 at 21:54
9

To use openssl/bn.h on Linux:

$ sudo apt-get install libcurl4-openssl-dev
0
6

I would say that the OpenSSL headers are part of the Mac OS X environment, not part of the iOS environment. I you want OpenSSL for iOS, you need to compile it yourself. You'll find some help there (or alternatively there).

3
  • Thank u! Did you meant that OpenSSL is included in the MacOS environment but not yet in the CocoaTouch? I'll try those OpenSSL ports, thank you very much! Jul 7, 2011 at 18:23
  • @ss1271: That's what I meant. Jul 9, 2011 at 13:06
  • I am using Xcode 5 and i am unable to resolve the issue.Can u please help me?
    – Ganesh
    Jan 9, 2014 at 13:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.