1

Why does the following error occurs when I gmake to build ratpoison on x86 Solaris 10 with gcc 3.4.3

Undefined first referenced symbol in file strcasestr completions.o ld: fatal: symbol referencing errors. No output written to ratpoison collect2: ld returned 1 exit status gmake[2]: *** [ratpoison] Error 1

But _GNU_SOURCE is in completions.c.

/*
 * Per POSIX strcasestr should be declared in strings.h
 * glibc declares it in string.h instead and needs 
 * _ GNU_SOURCE
 */
  #define _GNU_SOURCE
  #include <strings.h>
  #include <string.h>
Florian Weimer
  • 32,022
  • 3
  • 48
  • 92
Bishnu
  • 177
  • 1
  • 10

1 Answers1

1

strcasestr is a GNU extension. It's not part of Solaris libc. Gnulib has an implementation of strcasestr you could use. See the instructions for using gnulib-tool.

Florian Weimer
  • 32,022
  • 3
  • 48
  • 92