Skip to content

Instantly share code, notes, and snippets.

@caike
Created May 30, 2010 16:55
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save caike/419159 to your computer and use it in GitHub Desktop.
Save caike/419159 to your computer and use it in GitHub Desktop.
Ruby 1.9.0.0 compile error (openssl problem)
TAGS: None
Found these error:
view sourceprint?
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).
#411 //int BN_rand_range(BIGNUM *rnd, const BIGNUM *range);
#412 //int BN_pseudo_rand_range(BIGNUM *rnd, const BIGNUM *range);
view sourceprint?
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.
http://blog.cyberheb.com/2010/01/07/ruby-1-9-0-0-compile-error-openssl-problem/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment