On Solaris 8 with gcc I'm seeing this link error:

g++      -o test-wctype-c++ test-wctype-c++.o ../gllib/libgnu.a  -lrt 
Undefined                       first referenced
 symbol                             in file
iswblank(long)                      test-wctype-c++.o
ld: fatal: Symbol referencing errors. No output written to test-wctype-c++
collect2: ld returned 1 exit status
*** Error code 1

The cause is C++ name mangling. This fixes it:


2010-12-25  Bruno Haible  <br...@clisp.org>

        iswblank: Fix C++ link error on Solaris 8.
        * lib/wctype.in.h (iswblank): Declare using _GL_FUNCDECL_RPL or
        _GL_FUNCDECL_SYS.

--- lib/wctype.in.h.orig        Sat Dec 25 16:53:32 2010
+++ lib/wctype.in.h     Sat Dec 25 16:52:22 2010
@@ -284,9 +284,9 @@
 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 #   define iswblank rpl_iswblank
 #  endif
-extern int rpl_iswblank (wint_t wc);
+_GL_FUNCDECL_RPL (iswblank, int, (wint_t wc));
 # else
-extern int iswblank (wint_t wc);
+_GL_FUNCDECL_SYS (iswblank, int, (wint_t wc));
 # endif
 
 #endif

Reply via email to