windows下mingw编译gcc出错 [求助]

chinayeren 2012-03-08 10:28:22
$ 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后还是有这样的错误?卡了好久都无法解决
...全文
430 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
chinayeren 2012-03-08
  • 打赏
  • 举报
回复
编译真费劲啊,解决一个问题又有一个问题........ 有编译过的吗?给些指点啊
$ 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'
make[3]: Leaving directory `/gcc-4.6.2/host-i686-pc-mingw32/gcc'
Checking multilib configuration for libgcc...
Configuring stage 1 in i686-pc-mingw32/libgcc
configure: loading cache ./config.cache
checking for --enable-version-specific-runtime-libs... no
checking for a BSD-compatible install... /bin/install -c
checking for gawk... gawk
checking build system type... i686-pc-mingw32
checking host system type... i686-pc-mingw32
checking for i686-pc-mingw32-ar... ar
checking for i686-pc-mingw32-lipo... lipo
checking for i686-pc-mingw32-nm... /gcc-4.6.2/host-i686-pc-mingw32/gcc/nm
checking for i686-pc-mingw32-ranlib... ranlib
checking for i686-pc-mingw32-strip... strip
checking whether ln -s works... yes
checking for i686-pc-mingw32-gcc... /gcc-4.6.2/host-i686-pc-mingw32/gcc/xgcc -B/
gcc-4.6.2/host-i686-pc-mingw32/gcc/ -L/gcc-4.6.2/i686-pc-mingw32/winsup/mingw -L
/gcc-4.6.2/i686-pc-mingw32/winsup/w32api/lib -isystem /gcc-4.6.2/winsup/mingw/in
clude -isystem /gcc-4.6.2/winsup/w32api/include -B/usr/local/i686-pc-mingw32/bin
/ -B/usr/local/i686-pc-mingw32/lib/ -isystem /usr/local/i686-pc-mingw32/include
-isystem /usr/local/i686-pc-mingw32/sys-include
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether /gcc-4.6.2/host-i686-pc-mingw32/gcc/xgcc -B/gcc-4.6.2/host-i686
-pc-mingw32/gcc/ -L/gcc-4.6.2/i686-pc-mingw32/winsup/mingw -L/gcc-4.6.2/i686-pc-
mingw32/winsup/w32api/lib -isystem /gcc-4.6.2/winsup/mingw/include -isystem /gcc
-4.6.2/winsup/w32api/include -B/usr/local/i686-pc-mingw32/bin/ -B/usr/local/i686
-pc-mingw32/lib/ -isystem /usr/local/i686-pc-mingw32/include -isystem /usr/local
/i686-pc-mingw32/sys-include accepts -g... yes
checking for /gcc-4.6.2/host-i686-pc-mingw32/gcc/xgcc -B/gcc-4.6.2/host-i686-pc-
mingw32/gcc/ -L/gcc-4.6.2/i686-pc-mingw32/winsup/mingw -L/gcc-4.6.2/i686-pc-ming
w32/winsup/w32api/lib -isystem /gcc-4.6.2/winsup/mingw/include -isystem /gcc-4.6
.2/winsup/w32api/include -B/usr/local/i686-pc-mingw32/bin/ -B/usr/local/i686-pc-
mingw32/lib/ -isystem /usr/local/i686-pc-mingw32/include -isystem /usr/local/i68
6-pc-mingw32/sys-include option to accept ISO C89... unsupported
checking how to run the C preprocessor... /lib/cpp
configure: error: in `/gcc-4.6.2/i686-pc-mingw32/libgcc':
configure: error: C preprocessor "/lib/cpp" fails sanity check
See `config.log' for more details.
make[2]: *** [configure-stage1-target-libgcc] Error 1
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
chinayeren 2012-03-08
  • 打赏
  • 举报
回复
悲剧 我发现问题了
The directory that should contain system headers does not exist:
/mingw/include
目录是空的~~~~~~~~~~~~~~~~~
redleaves 2012-03-08
  • 打赏
  • 举报
回复
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即可.
ouyh12345 2012-03-08
  • 打赏
  • 举报
回复
configure: error: C preprocessor "/lib/cpp" fails sanity check

64,647

社区成员

发帖
与我相关
我的任务
社区描述
C++ 语言相关问题讨论,技术干货分享,前沿动态等
c++ 技术论坛(原bbs)
社区管理员
  • C++ 语言社区
  • encoderlee
  • paschen
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
  1. 请不要发布与C++技术无关的贴子
  2. 请不要发布与技术无关的招聘、广告的帖子
  3. 请尽可能的描述清楚你的问题,如果涉及到代码请尽可能的格式化一下

试试用AI创作助手写篇文章吧