使用 MinGW 在 Windows 上安装 GMP 时出错
Error when installing GMP on Windows with MinGW
我使用的是WinLibs提供的带有MinGW的Windows10。
我尝试使用Windows平台的GMP安装说明给出的说明安装GMP库。
我已经做过这些
- 在
C:/mingw64
安装MinGW - 在
C:/MSYS/1.0
中安装 MSYS - 下载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
来完成安装,但由于最后一步失败,我不能。
这里有什么问题?我该如何解决它?
我只是自己修复了它。(推断的(问题是,当我完成 MSSYS 安装时,安装后脚本的自动运行失败,我只是忽略了它。
手动运行postinstall.bat
后,GMP 库按预期编译。
相关文章:
- 访问者访问变体并返回不同类型时出错
- 在Linux for Windows上编译C++代码时出错
- 读取文件的最后一行并输入到链接列表时出错
- 重载操作程序时出错>>用于类中的字符串 memebr
- 调用专用模板时出错"no matching function for call to [...]"
- C++-试图将函数指针推回到另一个CPP文件中的矢量时出错
- LINK 尝试使用 OpenSSL evp aes 256 c++ 时出错
- 在Google Kick start中提交时出错
- 在c++中访问int到类对象的映射时出错
- 分段错误当我试图运行程序时出错
- 使用dynamic_cast和构造函数时出错
- CHECK(调用)函数在Google Colab中出错
- 用pybind11包装C++抽象类时出错
- 为x86而非x64编译时出错
- 从R调用C++函数并对其进行集成时出错
- 这个函数哪里出错了
- 使用 MinGW 在 Windows 上安装 GMP 时出错
- 链接GMP库时出错
- 安装 GMP 时出错
- 配置gmp时出错