Compile Error: ldap.c:424: error: ‘LDAP_OP T_X_TLS_PROTOCOL’ undeclared (first use in this fun


#1

root@leopard:~/libldap-ruby-0.9.7# make
gcc -I. -I. -I/usr/local/lib/ruby/1.8/i686-linux -I. -DUSE_OPENLDAP2
-DUSE_OPENLDAP -DLDAP_DEPRECATED -D_REENTRANT -DHAVE_LDAP_H
-DHAVE_LBER_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 -D_FILE_OFFSET_BITS=64 -fPIC -g
-O2 -c
ldap.c
ldap.c: In function ‘Init_ldap’:
ldap.c:424: error: ‘LDAP_OPT_X_TLS_PROTOCOL’ undeclared (first use in
this function)
ldap.c:424: error: (Each undeclared identifier is reported only once
ldap.c:424: error: for each function it appears in.)
make: *** [ldap.o] Error 1
root@leopard:~/libldap-ruby-0.9.7#
----snip----
I followed the directions in the README under ‘BUILDING’. I was able to
get the
extconf.rb to run after doing apt-get install libldap2-dev. I had
already
successfully built and installed ruby and openssl from source on this
Ubuntu
Server: root@leopard:~# uname -a
Linux leopard 2.6.28-11-server #42-Ubuntu SMP Fri Apr 17 02:48:10 UTC
2009 i686
GNU/Linux
openssl appears to be working, and is installed in the appropriate spot.
This
is probably just an omission I am not guessing. Can someone see
something
obvious? If not I’ll file a bug tomorrow.

Perhaps this is not a roadblock, but it appears to be a real bug if it
cannot
compile. I see not reference to the symbol LOAD_OPT_X_TLS_PROTOCOL in
the
directory tree.


#2

Xeno C. wrote:

-O2 -c ldap.c
had already successfully built and installed ruby and openssl from
source on this Ubuntu Server: root@leopard:~# uname -a
Linux leopard 2.6.28-11-server #42-Ubuntu SMP Fri Apr 17 02:48:10 UTC
2009 i686 GNU/Linux
openssl appears to be working, and is installed in the appropriate
spot. This is probably just an omission I am not guessing. Can someone
see something obvious? If not I’ll file a bug tomorrow.

Perhaps this is not a roadblock, but it appears to be a real bug if it
cannot compile. I see not reference to the symbol
Sorry. I should have said LDAP_OPT_X_TLS_PROTOCOL does not exist in the
tree
except in conn.c and ldap.c.


#3

This is standard C debugging, so I don’t think it really belongs on a
Ruby list any more.

$ find /usr/include -type f | xargs grep LDAP_OPT_X_TLS_PROTOCOL
/usr/include/ldap.h:/* #define LDAP_OPT_X_TLS_PROTOCOL 0x6007 */

So the constant exists in the openldap headers, but is commented out for
some reason. A note earlier in the file says this is an openldap private
option.

As to why ruby-ldap uses this option, but openldap doesn’t provide it:
well, that’s something to do with the ruby-ldap library. If you look at
the patches which the Ubuntu package applies to make it build, you’ll
probably find what they do to fix it.