首页 > 解决方案 > 为什么当我使用 gcc 3.4.3 在 x86 Solaris 10 上构建 ratpoison 时会出现以下错误

问题描述

为什么当我使用 gcc 3.4.3 在 x86 Solaris 10 上构建 ratpoison 时会出现以下错误

文件 strcasestr completions.old 中未定义的第一个引用符号:致命:符号引用错误。没有输出写入ratpoison collect2:ld返回1退出状态gmake [2]:*** [ratpoison]错误1

但是 _GNU_SOURCE 在 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>

标签: gnulib

解决方案


strcasestr是一个 GNU 扩展。它不是 Solaris libc 的一部分。Gnulib 有一个你可以使用的实现。strcasestr请参阅使用说明gnulib-tool


推荐阅读