Golang安装go-sqlcipher出错[openssl/r

2018-01-22  本文已影响184人  路过麦田

在安装go-sqlcipher时遇到了下面的错误:

go get -v github.com/xeodou/go-sqlcipher
github.com/xeodou/go-sqlcipher
# github.com/xeodou/go-sqlcipher
../github.com/xeodou/go-sqlcipher/sqlite3-binding.c:18280:10: fatal error: openssl/rand.h: No such file or directory
#include <openssl/rand.h>
^~~~~~~~~~~~~~~~
compilation terminated.

提示找不到openssl/rand.h文件,如果你也遇到了同样的问题,可以尝试下面的方案:

# for macOS:

brew install openssl
brew link openssl --force

# for Debian, Ubuntu
sudo apt-get install libssl-dev

完成之后,重新安装即可。

go get -v github.com/xeodou/go-sqlcipher
上一篇下一篇

猜你喜欢

热点阅读