Bishnu
Bishnu

Reputation: 317

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

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>

Upvotes: 2

Views: 52

Answers (2)

Polluks
Polluks

Reputation: 572

strcasecmp(3) is not in the C or C++ standard. However, it's defined by POSIX.1-2001 and 4.4BSD. The primary compiler of Solaris 10 was Sun Studio 10.

Upvotes: 0

Florian Weimer
Florian Weimer

Reputation: 33719

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.

Upvotes: 1

Related Questions