windows - 在 Windows 上用 ruby​​ 编译 openssl

标签 windows ruby openssl compiler-errors

我正在尝试在装有 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
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

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

最佳答案

请问您为什么要尝试编译 openssl 扩展?

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

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

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

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

希望对您有所帮助。

关于windows - 在 Windows 上用 ruby​​ 编译 openssl,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3242486/

相关文章:

windows - 对于触摸屏界面,您会使用哪个 GUI 工具包?

c - 尽快使用 OpenSSL 的 BIGNUM 拆分数字

windows - 文件夹图标更改不生效

C# 从 DataGridView 插入 MySQL 数据后被截断

ruby - 测试抽象的 if 条件

ruby-on-rails - 在 Rails 3.2.3 服务器中,我收到错误 304 Not Modified (5ms)

QT QSslError 收到错误代码设置为 NoError 的信号

c++ - "error: expected unqualified-id before ' 。 '"使用 OpenSSL 库编译 C++ 应用程序

windows - 鼠标单击是 WM_* 消息还是向上和向下消息的组合?

ruby - 像 sh -x 一样回显每个 Ruby 代码行?