MinGW:建立GCC需要GMP 4.2 +,MP​​FR 2.4.0+和MPC 0.8.0+

时间:2016-04-18 11:29:30

标签: windows gcc mingw gnu msys

我正在尝试使用MinGW软件在运行Windows 10的PC上构建GCC-5.3.0。 我收到了这个错误

configure: error: Building GCC requires GMP 4.2+, MPFR 2.4.0+ and MPC 
0.8.0+.
Try the --with-gmp, --with-mpfr and/or --with-mpc options to specify
their locations.  Source code for these libraries can be found at
their respective hosting sites as well as at
ftp://gcc.gnu.org/pub/gcc/infrastructure/.  See also
http://gcc.gnu.org/install/prerequisites.html for additional info.  If
you obtained GMP, MPFR and/or MPC from a vendor distribution package,
make sure that you have installed both the libraries and the header
files.  They may be located in separate packages.

我的输入是

username@computername /d/gnu/gcc-5.3.0-build
$ ../gcc-5.3.0/configure --target arm-eabi --enable-win32-registry=My
ToolchainName --prefix /f/gnu/out/ --enable-languages=c,c++ --disable
-nls --disable-shared --with-newlib --with-headers=../newlib-2.4.0/ne
wlib/libc/include

注意:/ d / path为我的D:/ drive

我在环境变量中添加了路径

D:\MinGW\bin

我已经从MinGW安装管理器安装了libgmp 5.1.2,libmpfr 3.1.2和libmpc 1.0.2

我按照http://gnutoolchains.com/building/的指南在Windows上构建我自己的GNU工具链

2 个答案:

答案 0 :(得分:0)

错误消息不言自明:您需要通过--with-*选项提供指向所需库的路径,例如--with-gmp=/d/path/to/gmp

答案 1 :(得分:0)

下载更多库包构建并将其安装到新文件夹中,例如/ c / gnu / install

gmp-6.1.2.tar.bz2
mpfr-3.1.5.tar.bz2
mpc-1.0.2.tar.gz

1>构建gmp

cd gmp-6.1.2
configure --prefix=/c/gnu/install/
make -j4 install

2 - ;建立mpfr

cd mpfr-3.1.5
configure --prefix=/c/gnu/install/ --with-gmp=/c/gnu/install/ --enable-static --disable-shared
make -j4 install

3>建立mpc

cd mpc-1.0.2
configure --prefix=/c/gnu/install/ --with-gmp=/c/gnu/install/ --with-mpfr=/c/gnu/install/ --enable-static --disable-shared
make -j4 install

然后使用选项配置构建gcc:

--with-gmp=/c/gnu/install/ --with-mpfr=/c/gnu/install/ --with-mpc=/c/gnu/install/