美文网首页
Golang安装go-sqlcipher出错[openssl/r

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

作者: 路过麦田 | 来源:发表于2018-01-22 16:07 被阅读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
    

    相关文章

      网友评论

          本文标题:Golang安装go-sqlcipher出错[openssl/r

          本文链接:https://www.haomeiwen.com/subject/riolaxtx.html