在安装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
网友评论