From: Xeno Campanoli Date: 2009-12-30T04:04:31+09:00 Subject: Re: ERRORs trying to install ruby-ldap on CentOS Eric Wong wrote: Okay, I found the sequence in the README. Sorry. It still fails, and I tried putting the preprocessor stuff you recommend both before and after the two initial includes in the file, with these results: # ruby extconf.rb --with-ldap-dir=/usr --with-openldap2 checking for ldap.h... yes checking for lber.h... yes checking for ldap_ssl.h... no checking for openssl/ssl.h... yes checking for openssl/crypto.h... yes checking for main() in -lcrypto... yes checking for main() in -lssl... yes checking for main() in -lnsl... yes checking for main() in -lpthread... yes checking for main() in -lresolv... yes checking for main() in -llber... yes checking for main() in -lldap_r... yes checking for main() in -lldap... yes checking for ldap_init()... yes checking for ldap_set_option()... yes checking for ldap_get_option()... yes checking for ldap_start_tls_s()... yes checking for ldap_memfree()... yes checking for ldap_perror()... yes checking for ldap_sort_entries()... yes checking for ldapssl_init()... no checking for ldap_sslinit()... no checking for ldap_sasl_bind_s()... yes checking for ldap_compare_s()... yes checking for ldap_add_ext_s()... yes checking for ldap_compare_ext_s()... yes checking for ldap_delete_ext_s()... yes checking for ldap_modify_ext_s()... yes checking for ldap_search_ext_s()... yes checking for ldap_unbind_ext_s()... yes checking for ldap_sasl_interactive_bind_s()... yes creating Makefile # make gcc -I. -I. -I/usr/lib64/ruby/1.8/x86_64-linux -I. -DUSE_OPENLDAP2 -DUSE_OPENLDAP -DLDAP_DEPRECATED -D_REENTRANT -DHAVE_LDAP_H -DHAVE_LBER_H -DHAVE_OPENSSL_SSL_H -DHAVE_OPENSSL_CRYPTO_H -DHAVE_LDAP_INIT -DHAVE_LDAP_SET_OPTION -DHAVE_LDAP_GET_OPTION -DHAVE_LDAP_START_TLS_S -DHAVE_LDAP_MEMFREE -DHAVE_LDAP_PERROR -DHAVE_LDAP_SORT_ENTRIES -DHAVE_LDAP_SASL_BIND_S -DHAVE_LDAP_COMPARE_S -DHAVE_LDAP_ADD_EXT_S -DHAVE_LDAP_COMPARE_EXT_S -DHAVE_LDAP_DELETE_EXT_S -DHAVE_LDAP_MODIFY_EXT_S -DHAVE_LDAP_SEARCH_EXT_S -DHAVE_LDAP_UNBIND_EXT_S -DHAVE_LDAP_SASL_INTERACTIVE_BIND_S -DRUBY_VERSION_CODE=185 -fPIC -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -Wall -fno-strict-aliasing -fPIC -c misc.c misc.c: In function ‘rb_ldap_get_apiinfo’: misc.c:63: warning: implicit declaration of function ‘RARRAY_LEN’ misc.c:67: warning: implicit declaration of function ‘RARRAY_PTR’ misc.c:67: error: subscripted value is neither array nor pointer make: *** [misc.o] Error 1 # ---snip--- I don't see any other of these R.*_ preprocessor functions (well, there is an RB.*something, but hopefully) so that maybe if you can give me an appropriate #define for that one it might work...???? xc > Xeno Campanoli wrote: >> misc.c: In function ‘rb_ldap_get_apiinfo’: >> misc.c:56: warning: implicit declaration of function ‘RARRAY_LEN’ >> misc.c:60: warning: implicit declaration of function ‘RARRAY_PTR’ >> misc.c:60: error: subscripted value is neither array nor pointer >> misc.c:61: warning: implicit declaration of function ‘RSTRING_LEN’ >> misc.c:61: warning: implicit declaration of function ‘RSTRING_PTR’ > > Hi Xeno, it looks like the code was ported to work with Ruby 1.9 and > didn't bother maintaining 1.8.5 (or 1.8.6?) compatibility. > > What happens when you add the following to misc.c? > > #ifndef RSTRING_PTR > # define RSTRING_PTR(s) (RSTRING(s)->ptr) > #endif > #ifndef RSTRING_LEN > # define RSTRING_LEN(s) (RSTRING(s)->len) > #endif > -- "It's the preponderance, stupid!" - Professor Stephen Schneider, IPCC member