Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
211 views
in Technique[技术] by (71.8m points)

c++ - g++ 4.7.1 compilation error : conflicting types for ‘strsignal’

I'm trying to compile g++ 4.7.1 from source on Ubuntu 12.04 32 bits. For the moment I've exactly done that : https://askubuntu.com/questions/168947/how-to-upgrade-g-to-4-7-1 Except just before the compilation of g++ 4.7.1 it asks me to "unset LIBRARY_PATH" (so I've done that). So the compilation starts, and after a while I have the following error message :

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’

(sorry, some error messages are in french : erreur -> error and division par zéro dans #if -> division by zero in #if).

What is the problem and how to solve it ?

(an other little question : what is the difference between ./configure and ./configure -v ?)

EDIT : the lines of strsignal in system.h

/* 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
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I used

unset LIBRARY_PATH CPATH C_INCLUDE_PATH PKG_CONFIG_PATH CPLUS_INCLUDE_PATH INCLUDE

Since I don't have root access on this machine, and so I have appended to a lot of those variables.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...