Ruby 1.9.0.0 compile error (openssl problem)

Found these error:

compiling openssl
gcc -I. -I../../.ext/include/i686-darwin10.2.0 -I../.././include -I../.././ext/openssl -DRUBY_EXTCONF_H=\"extconf.h\"    -fno-common -g -O2 -pipe -fno-common   -o openssl_missing.o -c openssl_missing.c
In file included from openssl_missing.c:22:
openssl_missing.h:119: error: conflicting types for ‘BN_rand_range’
/usr/include/openssl/bn.h:411: error: previous declaration of ‘BN_rand_range’ was here
openssl_missing.h:120: error: conflicting types for ‘BN_pseudo_rand_range’
/usr/include/openssl/bn.h:412: error: previous declaration of ‘BN_pseudo_rand_range’ was here
make[1]: *** [openssl_missing.o] Error 1
make: *** [all] Error 1

The error was caused by conflicting declaration of BN_rand_range and BN_pseudo_rand_range function defined on /usr/include/openssl/bn.h (Snow Leopard) and ext/openssl/openssl_missing.h (ruby ext).

file: /usr/include/openssl/bn.h
...
int	BN_rand_range(BIGNUM *rnd, const BIGNUM *range);
int	BN_pseudo_rand_range(BIGNUM *rnd, const BIGNUM *range);
...

file: ext/openssl/openssl_missing.h
...
int BN_rand_range(BIGNUM *r, BIGNUM *range);
int BN_pseudo_rand_range(BIGNUM *r, BIGNUM *range);
...

Commenting those 2 function on either file will solve the problem. This problem already solved on Ruby.1.9.1, so there will be no such problem compiling and installing that version of ruby on Snow Leopard. Just in case you found similar problem and you NEED to use 1.9.0.0, then above solution will solve it. Just for my personal record anyway.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s