I unset the C_INCLUDE_PATH to an empty string then the compilation proceeds further. But I don't know why I must unset C_INCLUDE_PATH. > ---------- 已转发邮件 ---------- > From: xinsan Chen <xinsan.chen@xxxxxxxxx> > To: gcc-help@xxxxxxxxxxx > Date: Fri, 20 Nov 2009 11:26:24 +0800 > Subject: trouble building 4.4.2: 'CHAR_BIT' undeclared > hi, all > I installed gmp4.2.4 and mpfr2.4.1 to /usr/local > Then, I tried to install gcc 4.4.2, but some errors occur. > > %configure --prefix=/home/cj --enable-languages=c,c++,fortran > --with-gmp=/usr/local/lib --with-mpfr=/usr/local/lib > %mke check (is ok!) > %mke > > C_INCLUDE_PATH=/usr/local/include:/usr/include > LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH > LIBRARY_PATH=/usr/local/lib:$LIBRARY_PATH > > make[3]: Entering directory > `/home/cj/gcc-4.4.2/host-x86_64-unknown-linux-gnu/gcc' > gcc -c -g -fkeep-inline-functions -DIN_GCC -W -Wall -Wwrite-strings > -Wstrict-prototypes -Wmissing-prototypes -Wcast-qual > -Wold-style-definition -Wc++-compat -Wmissing-format-attribute > -fno-common -DHAVE_CONFIG_H -I. -I. -I../.././gcc -I../.././gcc/. > -I../.././gcc/../include -I../.././gcc/../libcpp/include > -I/usr/include -I/usr/local/include -I../.././gcc/../libdecnumber > -I../.././gcc/../libdecnumber/bid -I../libdecnumber > ../.././gcc/c-lang.c -o c-lang.o > In file included from ../.././gcc/input.h:25, > from ../.././gcc/tree.h:27, > from ../.././gcc/c-lang.c:27: > ../.././gcc/../libcpp/include/line-map.h:66: error: 'CHAR_BIT' > undeclared here (not in a function) > ../.././gcc/../libcpp/include/line-map.h:66: error: bit-field 'reason' > width not an integer constant > ../.././gcc/../libcpp/include/line-map.h:66: warning: 'reason' is > narrower than values of its type > In file included from ../.././gcc/c-common.h:26, > from ../.././gcc/c-tree.h:25, > from ../.././gcc/c-lang.c:28: > ../.././gcc/../libcpp/include/cpplib.h:198: error: bit-field 'type' > width not an integer constant > ../.././gcc/../libcpp/include/cpplib.h:198: warning: 'type' is > narrower than values of its type > In file included from ../.././gcc/c-common.h:26, > from ../.././gcc/c-tree.h:25, > from ../.././gcc/c-lang.c:28: > ../.././gcc/../libcpp/include/cpplib.h:241:3: error: #error "Cannot > find a least-32-bit signed integer type" > ../.././gcc/../libcpp/include/cpplib.h:243: error: expected '=', ',', > ';', 'asm' or '__attribute__' before 'cppchar_t' > ../.././gcc/../libcpp/include/cpplib.h:244: error: expected '=', ',', > ';', 'asm' or '__attribute__' before 'cppchar_signed_t' > ../.././gcc/../libcpp/include/cpplib.h:732: error: expected '=', ',', > ';', 'asm' or '__attribute__' before 'cpp_interpret_charconst' > ../.././gcc/../libcpp/include/cpplib.h:743: error: expected '=', ',', > ';', 'asm' or '__attribute__' before 'cpp_host_to_exec_charset' > ../.././gcc/../libcpp/include/cpplib.h:870: error: expected '=', ',', > ';', 'asm' or '__attribute__' before 'cpp_parse_escape' > In file included from ../.././gcc/c-tree.h:26, > from ../.././gcc/c-lang.c:28: > ../.././gcc/toplev.h: In function 'floor_log2': > ../.././gcc/toplev.h:193: warning: control reaches end of non-void function > make[3]: *** [c-lang.o] Error 1 > make[3]: Leaving directory > `/home/cj/gcc-4.4.2/host-x86_64-unknown-linux-gnu/gcc' > make[2]: *** [all-stage1-gcc] Error 2 > make[2]: Leaving directory `/home/cj/gcc-4.4.2' > make[1]: *** [stage1-bubble] Error 2 > make[1]: Leaving directory `/home/cj/gcc-4.4.2' > make: *** [all] Error 2 > > I think CHAR_BIT is defined in /usr/include/limits.h but why it cannot > be searched. > > Juan > >