views:

45

answers:

1

Hello, i am trying to compile openssl with my ruby config on a windows computer with MingW. I am running ruby 1.9.2rc2 with these commands:

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

Okay, so that works without any errors. Let's try to 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

And here i get some errors. I do see what the error is saying but i cant understand it or solve it.

Thanks for all the help i can get.

A: 

Hello,

Can I ask you why are you trying to compile the openssl extension?

It is part of Ruby itself, and using the right OpenSSL version it should compile properly.

Hint from the directories you're working, seems you're using RubyInstaller based installers, or maybe trying to work from scratch?

If is from scratch, I would suggest you look into RubyInstaller project which provides a repository of compilation recipes located on GitHub:

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

Hope that helps.

Luis Lavena
I have compiled Ruby 1.9.2 from svn because there is no rubyinstaller for 1.9.2. Which openssl do you think i should use then?
Micke
There is, but not for rc2 due a bug introduced in gem_prelude. You can clone the repository, change the config for rc2 and build yourself if you want.
Luis Lavena
Forgot to mention: trust me, is the simplest road.
Luis Lavena
Now i have switched openssl version to 0.9.8 instead and now i don't get those errors but instead i get this error:`ossl_ssl.o: In function ssl_servername_cb:c:/ruby192rc2/ext/openssl/ossl_ssl.c:495: undefined reference to OSSL_get_servername`
Micke
Please clone the repository, change the version to rc2 and use it, or waste your time trying to get every extension working. Trust me, takes a lot of time and OpenSSL is one of the worse.
Luis Lavena
I have now cloned and done what you said but i am still getting an error during compilation. But this time it is with yaml. The error i get is: api.c:579: error: failure in redeclaration of 'yaml_token_delete': dllimport'd symbol lacks external linkage.api.c:579: confused by earlier errors, bailing out
Micke