【问题标题】:Compiling openssl with ruby on windows在 windows 上用 ruby​​ 编译 openssl
【发布时间】:2011-03-15 14:58:06
【问题描述】:

我正在尝试在装有 MingW 的 Windows 计算机上使用我的 ruby​​ 配置编译 openssl。

我正在使用以下命令运行 ruby​​ 1.9.2rc2:

$ ruby extconf.rb --with-openssl-dir=/c/openssl
...
...
...
=== Checking done. ===
creating extconf.h
creating Makefile
Done.

这工作没有任何错误。 当我尝试make:

$ make
gcc -I. -Ic:/Ruby192/include/ruby-1.9.1/i386-mingw32 -I/c/Ruby192/include/ruby-1
.9.1/ruby/backward -I/c/Ruby192/include/ruby-1.9.1 -I. -DRUBY_EXTCONF_H=\"extcon
f.h\" -Ic:/openssl/include    -O3 -g -Wall -Wno-unused-parameter -Wno-parenthese
s -Wpointer-arith -Wwrite-strings -Wno-long-long  -o openssl_missing.o -c openss
l_missing.c
In file included from openssl_missing.c:22:
openssl_missing.h:71: error: conflicting types for 'HMAC_CTX_copy'
c:/openssl/include/openssl/hmac.h:102: error: previous declaration of 'HMAC_CTX_
copy' was here
openssl_missing.h:71: error: conflicting types for 'HMAC_CTX_copy'
c:/openssl/include/openssl/hmac.h:102: error: previous declaration of 'HMAC_CTX_
copy' was here
openssl_missing.h:95: error: conflicting types for 'EVP_CIPHER_CTX_copy'
c:/openssl/include/openssl/evp.h:459: error: previous declaration of 'EVP_CIPHER
_CTX_copy' was here
openssl_missing.h:95: error: conflicting types for 'EVP_CIPHER_CTX_copy'
c:/openssl/include/openssl/evp.h:459: error: previous declaration of 'EVP_CIPHER
_CTX_copy' was here
make: *** [openssl_missing.o] Error 1

在这里我遇到了一些错误。我确实看到错误在说什么,但我无法理解或解决它。

【问题讨论】:

    标签: windows ruby openssl compiler-errors


    【解决方案1】:

    我能问你为什么要编译 openssl 扩展吗?

    它是 Ruby 本身的一部分,使用正确的 OpenSSL 版本应该可以正确编译。

    提示您正在工作的目录,您似乎正在使用基于 RubyInstaller 的安装程序,或者可能尝试从头开始工作?

    如果是从头开始,我建议您查看RubyInstaller 项目,该项目提供位于 GitHub 上的编译配方存储库:

    http://github.com/oneclick/rubyinstaller/

    希望对您有所帮助。

    【讨论】:

    • 我已经从 svn 编译了 Ruby 1.9.2,因为 1.9.2 没有 ruby​​installer。你认为我应该使用哪个 openssl?
    • 有,但不是 rc2,因为 gem_prelude 中引入了一个错误。您可以克隆存储库,更改 rc2 的配置并根据需要自行构建。
    • 忘了说:相信我,是最简单的路。
    • 现在我已将 openssl 版本切换为 0.9.8,现在我没有收到这些错误,而是收到此错误:ossl_ssl.o: In function ssl_servername_cb: c:/ruby192rc2/ext/openssl/ossl_ssl.c:495: undefined reference to OSSL_get_servername
    • 请克隆存储库,将版本更改为 rc2 并使用它,或者浪费您的时间尝试让每个扩展工作。相信我,这需要很多时间,而 OpenSSL 是最糟糕的一种。
    猜你喜欢
    • 1970-01-01
    • 2017-02-21
    • 1970-01-01
    • 2014-10-08
    • 1970-01-01
    • 1970-01-01
    • 2019-03-26
    • 2015-04-10
    • 2021-01-21
    相关资源
    最近更新 更多