Re: LDAP from ruby

-----Original Message-----
From: gregarican [mailto:[email protected]]
Sent: Thursday, December 15, 2005 8:38 AM
To: ruby-talk ML
Subject: Re: LDAP from ruby

Personally I ran into problems getting Ruby’s LDAP package to
compile in my Win32 environment. I tried using MSVC, Borland,
etc. to no avail. So I abandoned trying at the point of
getting myself tangled up in all of the extconf/mkmf stuff
that was over my head.

Perhaps there are others who have succeeded in this area. If
so I’d love to hear from them :slight_smile:

I just tried. First, pass “–with-wldap32” to extconf.rb. If you get a
an error regarding dlltool along the lines of “no such file or
directory”, go to line 168 and put the word ‘lib’ in front of dll tool,
so that the command looks like:

lib dlltool --dllname ...

However, after trying that, I ended up with these errors:

C:\ruby\src\ruby-ldap-0.9.2>nmake

Microsoft (R) Program Maintenance Utility Version 7.10.3077
Copyright (C) Microsoft Corporation. All rights reserved.

    cl -nologo -MD -Zi -O2b2xg- -G6 -DUSE_WLDAP32 -I./win

-I/usr/local/include -I. -Ic:/ruby/lib
/ruby/1.8/i386-mswin32 -Ic:/ruby/lib/ruby/1.8/i386-mswin32 -I.
-DHAVE_WINLDAP_H -DHAVE_WINLBER_H -DH
AVE_LDAP_INIT -DHAVE_LDAP_SET_OPTION -DHAVE_LDAP_GET_OPTION
-DHAVE_LDAP_MEMFREE -DHAVE_LDAP_PERROR -
DHAVE_LDAP_SSLINIT -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 -I.
-I./… -I./…/missing -c -Tcconn
.c
conn.c
win\winldap.h(188) : error C2059: syntax error : ‘}’
win\winldap.h(199) : error C2059: syntax error : ‘}’
win\winldap.h(230) : error C2059: syntax error : ‘}’
win\winldap.h(236) : error C2011: ‘timeval’ : ‘struct’ type redefinition
C:\Program Files\Microsoft Platform SDK for Windows XP
SP2\Include\WinSock.h(97) : see decla
ration of ‘timeval’
conn.c(8) : fatal error C1083: Cannot open include file: ‘sys/time.h’:
No such file or directory
NMAKE : fatal error U1077: ‘cl’ : return code ‘0x2’
Stop.

Looking at win\winldap.h I don’t understand why those are syntax errors.
The timeval struct definition can be removed altogether I think. An
#ifdef check needs to be added to conn.c for sys/time.h.

In short, ruby-ldap needs some TLC. If you can solve those issues, it
should work.

Regards,

Dan