# Re: LDAP from ruby

**URL:** <https://www.ruby-forum.com/t/re-ldap-from-ruby/50361>\
**Category:** Ruby\
**Created:** [December 15, 2005, 6:21pm UTC](https://www.ruby-forum.com/t/re-ldap-from-ruby/50361 "2005-12-15T18:21:56Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![BergerS\_Daniel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/bc8723/32.png) [@BergerS\_Daniel](https://www.ruby-forum.com/u/BergerS_Daniel)\
**Post date:** [December 15, 2005, 6:21pm UTC](https://www.ruby-forum.com/t/re-ldap-from-ruby/50361/1 "2005-12-15T18:21:56Z")

</div>

> -----Original Message-----  
> From: gregarican [[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)]  
> 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 🙂

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
