首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C++ >

windows上mingw编译gcc出错 []

2012-10-30 
windows下mingw编译gcc出错 [求助]$ make[ -f stage_final ] || echo stage3 stage_finalmake[1]: Enter

windows下mingw编译gcc出错 [求助]
$ make
[ -f stage_final ] || echo stage3 > stage_final
make[1]: Entering directory `/gcc-4.6.2'
make[2]: Entering directory `/gcc-4.6.2'
make[3]: Entering directory `/gcc-4.6.2'
rm -f stage_current
make[3]: Leaving directory `/gcc-4.6.2'
make[2]: Leaving directory `/gcc-4.6.2'
make[2]: Entering directory `/gcc-4.6.2'
make[3]: Entering directory `/gcc-4.6.2/host-i686-pc-mingw32/libiberty'
make[4]: Entering directory `/gcc-4.6.2/host-i686-pc-mingw32/libiberty/testsuite
'
make[4]: Nothing to be done for `all'.
make[4]: Leaving directory `/gcc-4.6.2/host-i686-pc-mingw32/libiberty/testsuite'

make[3]: Leaving directory `/gcc-4.6.2/host-i686-pc-mingw32/libiberty'
make[3]: Entering directory `/gcc-4.6.2/host-i686-pc-mingw32/lto-plugin'
make all-am
make[4]: Entering directory `/gcc-4.6.2/host-i686-pc-mingw32/lto-plugin'
make[4]: Nothing to be done for `all-am'.
make[4]: Leaving directory `/gcc-4.6.2/host-i686-pc-mingw32/lto-plugin'
make[3]: Leaving directory `/gcc-4.6.2/host-i686-pc-mingw32/lto-plugin'
make[3]: Entering directory `/gcc-4.6.2/host-i686-pc-mingw32/intl'
rm -f stamp-h1
/bin/sh ./config.status config.h
config.status: creating config.h
config.status: config.h is unchanged
test -f config.h || (rm -f stamp-h1 && make stamp-h1)
make[3]: Leaving directory `/gcc-4.6.2/host-i686-pc-mingw32/intl'
make[3]: Entering directory `/gcc-4.6.2/build-i686-pc-mingw32/libiberty'
make[4]: Entering directory `/gcc-4.6.2/build-i686-pc-mingw32/libiberty/testsuit
e'
make[4]: Nothing to be done for `all'.
make[4]: Leaving directory `/gcc-4.6.2/build-i686-pc-mingw32/libiberty/testsuite
'
make[3]: Leaving directory `/gcc-4.6.2/build-i686-pc-mingw32/libiberty'
make[3]: Entering directory `/gcc-4.6.2/build-i686-pc-mingw32/fixincludes'
make[3]: Nothing to be done for `all'.
make[3]: Leaving directory `/gcc-4.6.2/build-i686-pc-mingw32/fixincludes'
make[3]: Entering directory `/gcc-4.6.2/host-i686-pc-mingw32/zlib'
true "AR_FLAGS=rc" "CC_FOR_BUILD=gcc" "CFLAGS=-g -fkeep-inline-functions" "CXXFL
AGS=" "CFLAGS_FOR_BUILD=-g -O2" "CFLAGS_FOR_TARGET=-g -O2" "INSTALL=/bin/install
 -c" "INSTALL_DATA=/bin/install -c -m 644" "INSTALL_PROGRAM=/bin/install -c" "IN
STALL_SCRIPT=/bin/install -c" "LDFLAGS=-Wl,--stack,12582912" "LIBCFLAGS=-g -O2 -
D__USE_MINGW_ACCESS" "LIBCFLAGS_FOR_TARGET=-g -O2" "MAKE=make" "MAKEINFO=makeinf
o --split-size=5000000 --split-size=5000000 --split-size=5000000 " "PICFLAG=" "P
ICFLAG_FOR_TARGET=" "SHELL=/bin/sh" "EXPECT=expect" "RUNTEST=runtest" "RUNTESTFL
AGS=" "exec_prefix=/usr/local" "infodir=/usr/local/share/info" "libdir=/usr/loca
l/lib" "prefix=/usr/local" "tooldir=/usr/local/i686-pc-mingw32" "AR=ar" "AS=as"
"CC=gcc" "CXX=g++" "LD=e:/mingw32/bin/../lib/gcc/mingw32/4.5.0/../../../../mingw
32/bin/ld.exe" "LIBCFLAGS=-g -O2 -D__USE_MINGW_ACCESS" "NM=nm" "PICFLAG=" "RANLI
B=ranlib" "DESTDIR=" DO=all multi-do # make
make[3]: Leaving directory `/gcc-4.6.2/host-i686-pc-mingw32/zlib'
make[3]: Entering directory `/gcc-4.6.2/host-i686-pc-mingw32/libcpp'
make[3]: Nothing to be done for `all'.
make[3]: Leaving directory `/gcc-4.6.2/host-i686-pc-mingw32/libcpp'
make[3]: Entering directory `/gcc-4.6.2/host-i686-pc-mingw32/libdecnumber'
make[3]: Nothing to be done for `all'.
make[3]: Leaving directory `/gcc-4.6.2/host-i686-pc-mingw32/libdecnumber'
make[3]: Entering directory `/gcc-4.6.2/host-i686-pc-mingw32/gcc'
rm -rf include-fixed; mkdir include-fixed


chmod a+rx include-fixed
if [ -d ../prev-gcc ]; then \
  cd ../prev-gcc && \
  make real-install-headers-tar DESTDIR=`pwd`/../gcc/ \
  libsubdir=. ; \
  else \
  set -e; for ml in `cat fixinc_list`; do \
  sysroot_headers_suffix=`echo ${ml} | sed -e 's/;.*$//'`; \
  multi_dir=`echo ${ml} | sed -e 's/^[^;]*;//'`; \
  fix_dir=include-fixed${multi_dir}; \
  if ! false && test ! -d `echo /mingw/include | sed -e :a -e 's,[^/]*
/\.\.\/,,' -e ta`; then \
  echo The directory that should contain system headers does not exi
st: >&2 ; \
  echo " `echo /mingw/include | sed -e :a -e 's,[^/]*/\.\.\/,,' -e
ta`" >&2 ; \
  tooldir_sysinc=`echo "/usr/local/lib/gcc/i686-pc-mingw32/4.6.2/../
../../../i686-pc-mingw32/sys-include" | sed -e :a -e "s,[^/]*/\.\.\/,," -e ta`;
\
  if test "x`echo /mingw/include | sed -e :a -e 's,[^/]*/\.\.\/,,' -
e ta`" = "x${tooldir_sysinc}"; \
  then sleep 1; else exit 1; fi; \
  fi; \
  /bin/sh ../.././gcc/../mkinstalldirs ${fix_dir}; \
  chmod a+rx ${fix_dir} || true; \
  (TARGET_MACHINE='i686-pc-mingw32'; srcdir=`cd ../.././gcc; ${PWDCMD-
pwd}`; \
  SHELL='/bin/sh'; MACRO_LIST=`${PWDCMD-pwd}`/macro_list ; \
  gcc_dir=`${PWDCMD-pwd}` ; \
  export TARGET_MACHINE srcdir SHELL MACRO_LIST && \
  cd ../../build-i686-pc-mingw32/fixincludes && \
  /bin/sh ./fixinc.sh "${gcc_dir}/${fix_dir}" \
  `echo /mingw/include | sed -e :a -e 's,[^/]*/\.\.\/,,' -e ta` )
; \
  rm -f ${fix_dir}/syslimits.h; \
  if [ -f ${fix_dir}/limits.h ]; then \
  mv ${fix_dir}/limits.h ${fix_dir}/syslimits.h; \
  else \
  cp ../.././gcc/gsyslimits.h ${fix_dir}/syslimits.h; \
  fi; \
  chmod a+r ${fix_dir}/syslimits.h; \
  done; \
  fi
The directory that should contain system headers does not exist:
  /mingw/include
make[3]: *** [stmp-fixinc] Error 1
make[3]: Leaving directory `/gcc-4.6.2/host-i686-pc-mingw32/gcc'
make[2]: *** [all-stage1-gcc] Error 2
make[2]: Leaving directory `/gcc-4.6.2'
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory `/gcc-4.6.2'
make: *** [all] Error 2
按照教程已经安装了win32api mpr mpcf gmp libtool regex flex binutils libintl bison libiconv 
貌似能装的都装了 为什么make后还是有这样的错误?卡了好久都无法解决

[解决办法]
configure: error: C preprocessor "/lib/cpp" fails sanity check


[解决办法]
4.6.3已经出了,4.7也快出了.
用新的吧. 一般情况下,mingw编译gcc就是CRT和SDK的路径容易出错.

error: C preprocessor "/lib/cpp" fails sanity check
这个错我这次编译4.6.3也遇到了.是makefile的问题,找不到cpp程序.只要把mingw/bin映射到/lib就可以了.直接修改/etc/fstab即可.

热点排行