Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

openssl/bn.h: No such file or directory

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!!

like image 671
dumbfingers Avatar asked Jul 04 '11 15:07

dumbfingers


3 Answers

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.

like image 64
Eliot Gillum Avatar answered Nov 12 '22 13:11

Eliot Gillum


To use openssl/bn.h on Linux:

$ sudo apt-get install libcurl4-openssl-dev
like image 9
Thiago Pereira Avatar answered Nov 12 '22 14:11

Thiago Pereira


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

like image 6
Mathias Brossard Avatar answered Nov 12 '22 14:11

Mathias Brossard