c++ - g++ 4.7.1 编译错误 : conflicting types for ‘strsignal’

标签 c++ compilation g++ ubuntu-12.04

我正在尝试在 Ubuntu 12.04 32 位上从源代码编译 g++ 4.7.1。 目前我已经完全做到了:https://askubuntu.com/questions/168947/how-to-upgrade-g-to-4-7-1 除了在编译 g++ 4.7.1 之前,它要求我“取消设置 LIBRARY_PATH”(所以我已经这样做了)。 所以编译开始了,过了一会儿我收到以下错误消息:

In file included from ../.././gcc/c-lang.c:24:0:
../.././gcc/system.h:499:20: erreur: conflicting types for ‘strsignal’
/usr/include/string.h:566:14: note: previous declaration of ‘strsignal’ was here
In file included from ./tm.h:19:0,
                 from ../.././gcc/c-lang.c:26:
./options.h:3738:2: erreur: #error too many masks for ix86_isa_flags
In file included from ../.././gcc/input.h:25:0,
                 from ../.././gcc/tree.h:27,
                 from ../.././gcc/c-lang.c:27:
../.././gcc/../libcpp/include/line-map.h:208:38: erreur: ‘CHAR_BIT’ undeclared here (not in a function)
../.././gcc/../libcpp/include/line-map.h:208:3: erreur: bit-field ‘reason’ width not an integer constant
../.././gcc/../libcpp/include/line-map.h:208:3: attention : ‘reason’ is narrower than values of its type [enabled by default]
In file included from ../.././gcc/tree.h:32:0,
                 from ../.././gcc/c-lang.c:27:
../.././gcc/hwint.h:17:39: erreur: division par zéro dans #if
../.././gcc/hwint.h:17:39: erreur: division par zéro dans #if
../.././gcc/hwint.h:17:39: erreur: division par zéro dans #if
../.././gcc/hwint.h:17:39: erreur: division par zéro dans #if
../.././gcc/hwint.h:17:39: erreur: division par zéro dans #if
../.././gcc/hwint.h:17:39: erreur: division par zéro dans #if
../.././gcc/hwint.h:17:39: erreur: division par zéro dans #if
../.././gcc/hwint.h:17:39: erreur: division par zéro dans #if
../.././gcc/hwint.h:17:39: erreur: division par zéro dans #if
../.././gcc/hwint.h:17:39: erreur: division par zéro dans #if
../.././gcc/hwint.h:17:39: erreur: division par zéro dans #if
../.././gcc/hwint.h:17:39: erreur: division par zéro dans #if
../.././gcc/real.h:105:9: erreur: #error "REAL_WIDTH > 6 not supported"
In file included from ../.././gcc/c-family/c-common.h:26:0,
                 from ../.././gcc/c-tree.h:25,
                 from ../.././gcc/c-lang.c:28:
../.././gcc/../libcpp/include/cpplib.h:225:3: erreur: bit-field ‘type’ width not an integer constant
../.././gcc/../libcpp/include/cpplib.h:225:3: attention : ‘type’ is narrower than values of its type [enabled by default]
../.././gcc/../libcpp/include/cpplib.h:267:3: erreur: #error "Cannot find a least-32-bit signed integer type"
../.././gcc/../libcpp/include/cpplib.h:269:35: erreur: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘cppchar_t’
../.././gcc/../libcpp/include/cpplib.h:270:1: erreur: unknown type name ‘CPPCHAR_SIGNED_T’
../.././gcc/../libcpp/include/cpplib.h:768:1: erreur: unknown type name ‘cppchar_t’
../.././gcc/../libcpp/include/cpplib.h:779:1: erreur: unknown type name ‘cppchar_t’
../.././gcc/../libcpp/include/cpplib.h:779:58: erreur: unknown type name ‘cppchar_t’
../.././gcc/../libcpp/include/cpplib.h:954:1: erreur: unknown type name ‘cppchar_t’

(抱歉,一些错误消息是法语的:erreur -> errordivision par zéro dans #if -> division by zero in #if)。

问题是什么以及如何解决?

(另一个小问题:./configure./configure -v 有什么区别?)

编辑:system.h 中的 strsignal 行

/* If the system doesn't provide strsignal, we get it defined in
   libiberty but no declaration is supplied.  */
#if !defined (HAVE_STRSIGNAL) \
    || (defined (HAVE_DECL_STRSIGNAL) && !HAVE_DECL_STRSIGNAL)
# ifndef strsignal
extern const char *strsignal (int);
# endif
#endif

最佳答案

我用过

unset LIBRARY_PATH CPATH C_INCLUDE_PATH PKG_CONFIG_PATH CPLUS_INCLUDE_PATH INCLUDE

因为我在这台机器上没有 root 访问权限,所以我附加了很多这些变量。

关于c++ - g++ 4.7.1 编译错误 : conflicting types for ‘strsignal’ ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12255058/

相关文章:

java - jar 文件将不会运行。在cmd中获取错误

c++ - 使用排序函数根据函数对列表进行排序

c++ - 编译器如何优化我们的代码?

c# - 将表达式评估为字符串,返回对象?

compilation - 什么是 RVA 和 VA?

使用 g++ 支持 C++0x IDE

c++ - 如何链接 netbeans (linux) 中的库?

c++ - 是否有检查数据文件中数据的功能

c++ - 获取 block 设备的大小 Linux/Windows

c++ - 如何访问 cv::canny 阈值的梯度幅值图像