Full_Name: Heiko Nardmann Version: 2.4.39 OS: MinGW32 URL: ftp://ftp.openldap.org/incoming/ Submission from: (NULL) (2001:a60:f08d:1:159e:f75f:8f0:44f1) In clients/tools/ldapsearch.c the address of 'strcasecmp' is taken (inside 'dosearch()') around line 1455. That means that 'strcasecmp' is exported as an undefined symbol into ldapsearch.o even if 'strcasecmp' is declared as 'always_inline'. MinGW is such a platform which offers 'strcasecmp' by providing an inline version of 'strcasecmp' (redirecting it to 'stricmp'). So this taking of an address breaks linking. Workaround: before 'dosearch()' I place a local wrapper: static int local_strcasecmp(const char *s1, const char *s2) { return strcasecmp(s1, s2); } and inside 'dosearch' instead of if( sortattr ) { (void) ldap_sort_entries( ld, &res, ( *sortattr == '\0' ) ? NULL : sortattr, strcasecmp ); } I now have if( sortattr ) { (void) ldap_sort_entries( ld, &res, ( *sortattr == '\0' ) ? NULL : sortattr, local_strcasecmp ); } Some options to really solve that issue: 1) use my approach for all platforms. 2) change autoconf stuff to detect whether 'strcasecmp' is just inlined (MinGW) or a "real" function (other platforms). Thx in advance! Heiko
I'm not sure what version of MinGW this report applied to. In the current version of MinGW32, strcasecmp exists as a stub in libmingwex.a. https://osdn.net/projects/mingw/scm/git/mingw-org-wsl/commits/93fc8c251370d5207558c59efbff49dcb21265fb In the current version of MinGW-w64, strcasecmp exists as an alias in libmsvcrt.a. https://github.com/mirror/mingw-w64/commit/3ce37840afba411f0cc836c5ff73a5f42d4eb2f0 It looks like there's no longer any need for OpenLDAP to do anything special with strcasecmp.