Trying to compile slapd on cygwin, what does this automake error mean?
-
19-08-2019 - |
Question
I'm trying to compile a very old verion of slapd (the LDAP server) on cygwin. Previously this ran on a Linux box, but for reasons beyond my control it must be made to work on a Windows server. It has been suggested that we might use cygwin to compile up the source-code.
Unfortunately the build fails during "configure" with the error message:
checking how to run the C preprocessor... cc -E checking for gcc... (cached) cc checking whether the C compiler (cc ) works... no configure: error: installation or configuration problem: C compiler cannot creat e executables.
The last few lines of config.log are:
configure: failed program was: #line 2822 "configure" #include "confdefs.h" int main() { return __EMX__; ; return 0; } configure:2845: checking how to run the C preprocessor configure:2866: cc -E conftest.c >/dev/null 2>conftest.out configure:2950: checking for gcc configure:3063: checking whether the C compiler (cc ) works configure:3079: cc -o conftest conftest.c 1>&5 /usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../i686-pc-cygwin/bin/ld: cannot find -luser32 collect2: ld returned 1 exit status configure: failed program was: #line 3074 "configure" #include "confdefs.h" main(){return(0);}
UPDATE: This is a win32 computer - cygwin does not included a shared-object called user32, but Windows XP does include an object called user32.dll - any idea if this might be what the linker is looking for?
UPDATE2: w32api is already installed, (3.13-1) - I note that there is a user32.lib as part of visual-stuido 2003 .Net - is there a way to make GCC in Cygwin use this?
Solution 3
After much trial & error I found the correct answer for this problem: The reason for this error is that the Cygwin environment was not set up correctly.
The login-user on a domain, and so the /etc/passwd & /etc/group files were not set up correctly by default. The solution was to make a local user-account and then re-build the passwd and groups files.
After that, GCC could build just fine.
Sounds crazy, I know.
OTHER TIPS
The root cause seems to be
/usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../i686-pc-cygwin/bin/ld: cannot find -luser32
This is either a problem with your cygwin installation, or the configure scripts are to old to recognise and handle the installation.
If -luser32 is failing, try installing the w32api
Cygwin package.