+ -
当前位置:首页 → 问答吧 → "unable to detect exception model"

"unable to detect exception model"

时间:2007-03-01

来源:互联网

编译gcc的时候出错了! 请帮忙一下.

checking whether to build shared libraries... yes
checking whether to build static libraries... yes
creating libtool
updating cache ./config.cache
configure: loading cache ./config.cache
checking how to run the C++ preprocessor... /lib/cpp
loading cache ./config.cache within ltconfig
checking host system type... i686-pc-linux-gnu
checking build system type... i686-pc-linux-gnu
ltcf-cxx.sh: error: problem compiling test program
checking for objdir... .libs
checking for /home/looking/MiniLinux/toolchains/toolsrc/gcc-4.1.1/host-i686-pc-linux-gnu/gcc/xgcc option to produce PIC... -DPIC
checking if /home/looking/MiniLinux/toolchains/toolsrc/gcc-4.1.1/host-i686-pc-linux-gnu/gcc/xgcc PIC flag -DPIC works... no
checking if /home/looking/MiniLinux/toolchains/toolsrc/gcc-4.1.1/host-i686-pc-linux-gnu/gcc/xgcc static flag works... no
finding the maximum length of command line arguments... (cached) 49153
checking if /home/looking/MiniLinux/toolchains/toolsrc/gcc-4.1.1/host-i686-pc-linux-gnu/gcc/xgcc supports -c -o file.o... (cached) yes
checking whether the linker (/home/looking/MiniLinux/toolchains/toolsrc/gcc-4.1.1/host-i686-pc-linux-gnu/gcc/collect-ld) supports shared libraries...
checking how to hardcode library paths into programs... unsupported
checking whether stripping libraries is possible... yes
checking dynamic linker characteristics... GNU/Linux ld.so
checking command to parse /home/looking/MiniLinux/toolchains/toolsrc/gcc-4.1.1/host-i686-pc-linux-gnu/gcc/nm output... failed
checking if libtool supports shared libraries... no
checking whether to build shared libraries... no
checking whether to build static libraries... yes
appending configuration tag "CXX" to libtool
checking for exception model to use... configure: error: unable to detect exception model
make[2]: *** [configure-target-libstdc++-v3] Error 1
make[2]: Leaving directory `/home/looking/MiniLinux/toolchains/toolsrc/gcc-4.1.1'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/looking/MiniLinux/toolchains/toolsrc/gcc-4.1.1'
make: *** [build_full_gcc] Error 2

作者: looking365   发布时间: 2007-03-01

gcc 原目录编译?还是?

作者: 晨想   发布时间: 2007-03-01

对,就是编译gcc-4.1.1的时候出现的.
makefile 中是这样的
./configure --prefix=$(PREFIX) --target=$(ARCH) \
--enable-clocale=gnu --enable-shared \
--enable-threads=posix --enable-__cxa_atexit \
--enable-languages=c,c++ --disable-libstdcxx-pch \
--disable-nls
$(MAKE) -C $(SRC_DIR)/$(GCC_NAME)
$(MAKE) -C $(SRC_DIR)/$(GCC_NAME) install

config.log 中是这样的:
configure:2301: checking for MPFR
configure:2314: gcc -o conftest -g -O2 conftest.c -lmpfr -lgmp 1>&5
configure:2308:18: mpfr.h: No such file or directory
configure: In function `main':
configure:2310: `mpfr_t' undeclared (first use in this function)
configure:2310: (Each undeclared identifier is reported only once
configure:2310: for each function it appears in.)
configure:2310: parse error before "n"
configure:2310: `n' undeclared (first use in this function)
configure: failed program was:
#line 2306 "configure"
#include "confdefs.h"
#include <gmp.h>
#include <mpfr.h>
int main() {
mpfr_t n; mpfr_init(n);
; return 0; }

这个mpfr.h是个什么文件呀!

作者: looking365   发布时间: 2007-03-02

看清楚我的问题

作者: 晨想   发布时间: 2007-03-02

"gcc 原目录编译?还是?"
不懂!!!! 啥意思叫 原目录?

我是解压gcc-core-4.1.1.tar.bz2 gcc-g++-4.1.1.tar.bz2
然后使用下面命令编译的.
./configure --prefix=$(PREFIX) --target=$(ARCH) \
--enable-clocale=gnu --enable-shared \
--enable-threads=posix --enable-__cxa_atexit \
--enable-languages=c,c++ --disable-libstdcxx-pch \
--disable-nls
$(MAKE) -C $(SRC_DIR)/$(GCC_NAME)
$(MAKE) -C $(SRC_DIR)/$(GCC_NAME) install

作者: looking365   发布时间: 2007-03-02

"GCC 的安装指南推荐用一个新建的目录来编译它,而不是在源码目录中"
这句话注意到了没有?

作者: csfrank   发布时间: 2007-03-02

哦! 请问,如何新建一个目录来编译.
我使用make -C GCC_DIR 这样可以么?
呵呵,有些迷惑,请帮忙

作者: looking365   发布时间: 2007-03-02

假设你在gcc-core-4.1.1目录下, 执行
$ mkdir -v ../gcc-core-build
$ cd ../gcc-core-build
$ ../gcc-core-4.1.1/configure --prefix=$(PREFIX) --target=$(ARCH) \
--enable-clocale=gnu --enable-shared \
--enable-threads=posix --enable-__cxa_atexit \
--enable-languages=c,c++ --disable-libstdcxx-pch \
--disable-nls

作者: future_god   发布时间: 2007-03-02

明白你的意思了! 我在修改!

作者: looking365   发布时间: 2007-03-02

我在F8环境下编译lfs6.3里的binutils-2.7和gcc-4.1.2的时候都再config.log里发现有找不到mpfr.h这个错误.
我是在另外的build目录下编译的,也是交叉编译的时候出现的错误.

作者: kicoo   发布时间: 2007-12-04

The MPFR library is a C library for multiple-precision floating-point computations with correct rounding.
-----------------------------------------------------------------------------------------------
在configure里面也说
-------------------------------------------------------------------------------------------------
--with-mpfr-dir=PATH this option has been REMOVED
--with-mpfr=PATH specify prefix directory for installed MPFR package.
Equivalent to --with-mpfr-include=PATH/include
plus --with-mpfr-lib=PATH/lib
--with-mpfr-include=PATH
specify directory for installed MPFR include files
--with-mpfr-lib=PATH specify directory for the installed MPFR library
--with-gmp-dir=PATH this option has been REMOVED
--with-gmp=PATH specify prefix directory for the installed GMP package.
Equivalent to --with-gmp-include=PATH/include
plus --with-gmp-lib=PATH/lib
--with-gmp-include=PATH specify directory for installed GMP include files
--with-gmp-lib=PATH specify directory for the installed GMP library

-----------------------------------------------------------------------------------------------
是不是应该用上--without-mpfr --without-gmp这两个选项了!!

作者: kicoo   发布时间: 2007-12-04