c++ - 使用 MinGW 在 Windows 上安装 GMP 时出错
问题描述
我在WinLibs提供的带有 MinGW 的 Windows10 上。
我尝试使用GMP Install Instruction for Windows Platform给出的说明安装 GMP 库。
我做过这些
- 安装 MinGW
C:/mingw64
- 安装 MSYS
C:/MSYS/1.0
- 下载GMP源码并解压到
D:/desktop/gmp-6.2.0
- 运行 MSYS 并
cd
进入D:/desktop/gmp-6.2.0
- 运行
./configure --prefix="D:/GMP" --disable-static --enable-shared
。这成功生成了一个Makefile
,并在控制台中显示这些信息:
configure: summary of build options:
Version: GNU MP 6.2.0
Host type: skylake-pc-mingw32
ABI: 64
Install prefix: D:/GMP
Compiler: gcc
Static libraries: no
Shared libraries: yes
- 运行
make
。该过程因这些错误信息而失败
In file included from set_str.c:57:
set_str.c: In function '__gmpf_set_str':
../gmp-impl.h:4435:29: warning: implicit declaration of function 'localeconv' [-Wimplicit-function-declaration]
4435 | #define GMP_DECIMAL_POINT (localeconv()->decimal_point)
| ^~~~~~~~~~
set_str.c:132:24: note: in expansion of macro 'GMP_DECIMAL_POINT'
132 | const char *point = GMP_DECIMAL_POINT;
| ^~~~~~~~~~~~~~~~~
../gmp-impl.h:4435:41: error: invalid type argument of '->' (have 'int')
4435 | #define GMP_DECIMAL_POINT (localeconv()->decimal_point)
| ^~
set_str.c:132:24: note: in expansion of macro 'GMP_DECIMAL_POINT'
132 | const char *point = GMP_DECIMAL_POINT;
| ^~~~~~~~~~~~~~~~~
make[2]: *** [set_str.lo] Error 1
make[2]: Leaving directory `/d/Desktop/gmp-6.2.0/mpf'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/d/Desktop/gmp-6.2.0'
make: *** [all] Error 2
- 我应该运行
make install
以完成安装,但由于最后一步失败,我不能。
这里有什么问题?我该如何解决?
解决方案
我自己修好了。(推断的)问题是,当我完成安装 MSYS 时,安装后脚本的自动运行失败,我只是忽略了它。
在我postinstall.bat
手动运行之后,GMP 库根据需要编译。
推荐阅读
- javascript - JQuery:无法识别已解析 HTML 中的元素
- arrays - 数组类型联合的问题
- docker - 在 Gitlab Runner 容器中构建 Docker 镜像
- javascript - Javascript for()。我错过了什么,或者这只是不以这种方式工作
- firebase - 在 React 中使用 Google Provider 重新验证 Firebase 用户
- python - 如何更正此 python dfs 搜索?
- vb.net - vb.net - 如何从任何驱动器打开应用程序
- vba - 我收到一条类型匹配错误的错误消息
- android - 约束布局响应式设计问题 - android(已关闭)
- teamcity - Teamcity - 如果任何代码更改包含某些字符/单词,则构建失败?