Skip to content

Unable to compile on Windows 7 #15

@bandlor

Description

@bandlor

Dear all,

I struggled whole day with this issue and failed to compile this on my Windows 7 box.
My setup is Ruby 1.9.3p0 (from Ruby Installer) or Ruby 1.9.3p194 (Bitnami Rubystack)
on Windows 7 Enterprise SP1, Ruby DevKit 4.5.2 (2011-12-29) and MS Visual Studio 9.0
(the only one with lib.exe working for me from different MS SKD Devel sets).

I followed https://github.com/alexey-chebotar/ruby-ldap/wiki/How-to-compile-ruby-ldap-on-Windows for compile instruction and modified the header files and replaced few remaining STR2CSTR with StringValueCStr. With other issues (MS Libs, searching for lib.exe and other) I spent all day on this and ended with:

C:\Data\Temp\ruby-ldap-0.9.8>make
generating ldap-i386-mingw32.def
compiling conn.c
conn.c: In function 'rb_ldap_conn_free':
conn.c:32:7: warning: implicit declaration of function 'ldap_unbind'
conn.c: In function 'rb_ldap_conn_get_option':
conn.c:559:2: warning: passing argument 1 of 'ldap_init' discards qualifiers from pointer target type
./win/winldap.h:264:7: note: expected 'PCHAR' but argument is of type 'const char *'
conn.c: In function 'rb_ldap_conn_result2error':
conn.c:712:3: error: lvalue required as unary '&' operand
conn.c:714:3: warning: implicit declaration of function 'ldap_result2error'
conn.c: In function 'rb_ldap_conn_invalidate_entry':
conn.c:763:3: error: lvalue required as unary '&' operand
conn.c: In function 'rb_ldap_parse_result':
conn.c:965:3: warning: implicit declaration of function 'ldap_parse_result'
make: *** [conn.o] Error 1

I gave up here (I am allergic to C), desperate and exhausted, searching for other options and found the pre-compiled version from Nazy (https://github.com/downloads/nazy/ruby-ldap/ruby-ldap-0.9.11-x86-mingw32.gem) - many thanks for that.

I thank you guys for the effort you made the and I hope I will still be able to use this lib in the future. I was using pre-compiled 0.9.8 with my Rails2 project, I hope this one will work well with Rails3.

Let me know if I can help with any testing etc.

Regards

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions