Fatal error creating SQLCipher (file "openssl / rand.h" not found)

I am trying to build SQLCipher on my mac and get a fatal error after running make.

System: OS X El Capitan I installed openssl after following this instruction.

Before running make, I statically linked libcrypto.a to the command

./configure --enable-tempstore=yes CFLAGS="-DSQLITE_HAS_CODEC" \ LDFLAGS="/usr/local/opt/openssl/lib/libcrypto.a" 

The error I received

 sqlite3.c:18280:10: fatal error: 'openssl/rand.h' file not found #include <openssl/rand.h> ^ 1 error generated. make: *** [sqlite3.lo] Error 1 
+5
source share
3 answers

Make sure brew is properly linked with openssl libraries. Run this command

  brew link openssl --force 

Then try again.

+1
source

I did not have brew on my machine, but I fixed this error in a different way. In Xcode, I went to Preferences-> locations → "source trees" → Click +, set OPENSSL_SRC to "full-path-to-openssl-source"

+1
source

I came across this specifically for the golang library that I was trying to install. I was getting the following error when trying to run go get github.com/xeodou/go-sqlcipher :

 # github.com/xeodou/go-sqlcipher project/src/github.com/xeodou/go-sqlcipher/sqlite3-binding.c:18280:10: fatal error: 'openssl/rand.h' file not found 

I fixed this by adding the following to my bash profile:

 export CGO_LDFLAGS="-L/usr/local/opt/openssl/lib" export CGO_CPPFLAGS="-I/usr/local/opt/openssl/include" 

Hope this helps.

+1
source

Source: https://habr.com/ru/post/1246890/


All Articles