簡體   English   中英

使用 MinGW 在 Windows 上安裝 GMP 時出錯

[英]Error when installing GMP on Windows with MinGW

我在WinLibs提供的帶有 MinGW 的 Windows10 上。

我嘗試使用GMP Install Instruction for Windows Platform的說明安裝 GMP 庫。

我做過這些

  1. C:/mingw64中安裝 MinGW
  2. C:/MSYS/1.0中安裝 MSYS
  3. 下載GMP源碼並解壓到D:/desktop/gmp-6.2.0
  4. 運行 MSYS 和cd進入D:/desktop/gmp-6.2.0
  5. 運行./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
  1. 運行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
  1. 我應該運行make install來完成安裝,但由於最后一步失敗,我不能。

這里有什么問題? 我該如何解決?

我自己修好了。 (推斷的)問題是,當我完成安裝 MSYS 后,安裝后腳本的自動運行失敗,我只是忽略了它。

在我手動運行postinstall.bat ,GMP 庫按需要編譯。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM