我正在尝试使用带有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
我在这里遇到了一些错误。我确实看到了错误的内容,但我无法理解或解决它。
答案 0 :(得分:3)
我可以问你为什么要编译openssl扩展名?
它是Ruby本身的一部分,使用正确的OpenSSL版本,它应该正确编译。
从您正在使用的目录中提示,您是在使用基于RubyInstaller的安装程序,还是尝试从头开始工作?
如果是从头开始,我建议您查看RubyInstaller项目,该项目提供了位于GitHub上的编译配方库:
http://github.com/oneclick/rubyinstaller/
希望有所帮助。