Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/sqlite/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/json/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Macos 生成SQLCipher时出现致命错误(';openssl/rand.h';文件未找到)_Macos_Sqlite_Osx Elcapitan_Sqlcipher - Fatal编程技术网

Macos 生成SQLCipher时出现致命错误(';openssl/rand.h';文件未找到)

Macos 生成SQLCipher时出现致命错误(';openssl/rand.h';文件未找到),macos,sqlite,osx-elcapitan,sqlcipher,Macos,Sqlite,Osx Elcapitan,Sqlcipher,我试图在我的mac上构建SQLCipher,运行make后出现致命错误 系统:OS X El Capitan 我按照说明安装了openssl 在运行make之前,我使用命令静态链接libcrypto.a ./configure --enable-tempstore=yes CFLAGS="-DSQLITE_HAS_CODEC" \ LDFLAGS="/usr/local/opt/openssl/lib/libcrypto.a" 我犯了一个错误 sqlite3.c:18280:10: f

我试图在我的mac上构建SQLCipher,运行make后出现致命错误

系统:OS X El Capitan 我按照说明安装了openssl

在运行make之前,我使用命令静态链接libcrypto.a

./configure --enable-tempstore=yes CFLAGS="-DSQLITE_HAS_CODEC" \
    LDFLAGS="/usr/local/opt/openssl/lib/libcrypto.a"
我犯了一个错误

sqlite3.c:18280:10: fatal error: 'openssl/rand.h' file not found
#include <openssl/rand.h>
         ^
1 error generated.
make: *** [sqlite3.lo] Error 1
sqlite3.c:18280:10:致命错误:“未找到openssl/rand.h”文件
#包括
^
生成1个错误。
make:**[sqlite3.lo]错误1

确保brew已正确链接到openssl库。运行此命令

 brew link openssl --force

然后再试一次

我的机器上没有brew,但我用另一种方式修复了此错误。在Xcode中,我进入了Preferences->locations->“source trees”->单击+,将OPENSSL_SRC设置为“OPENSSL源代码的完整路径”

我在尝试安装golang库时遇到了这个问题。当我尝试运行
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
我通过将以下内容添加到我的bash配置文件中修复了此问题:

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

希望这能有所帮助。

我做了所有这些,但对我有效的是:
brew重新安装openssl
,当然你应该是/usr/local的所有者,以确保:
sudo chown-R username/usr/local


希望这能帮助任何需要帮助的人。

。我只需要添加一个选项——覆盖选项最新的macos版本不允许您更改
/usr/local
的所有权。但是您仍然可以更改子文件夹的所有者,因此应该改用
sudo chown-R username/usr/local/*