How to compile GMP for windows using Visual Studio

时间秒杀一切 提交于 2021-02-04 19:49:06

问题


I am trying to install gmp on windows. I have found the mingw way of compiling from sources on windows. But was unable to find binaries fro gmp 6.1.2 or visual studio project in order to compile from sources. So the question is: Where can I download the gmp 6.1.2 binaries or compile from sources using Visual Studio.


回答1:


Compiling GMP on Windows with VisualStudio might be tricky, however there are already some SO questions, that might help you (depending on your exact use-case):

  • Building GMP library with Visual Studio?
  • How to install MPFR and GMP for C++ on visual studio
  • GMP on visual studio c++

Simple answer is, that there are no sources of GMP compilable directly using VisualStudio as GMP is developed with UNIX in mind.

Summary of your options:

  1. Use GMP version provided in your MinGW distribution
  2. Compile own GMP using MinGW/Cygwin
  3. Use MPIR fork of GMP compilable using VisualStudio
  4. Try to solve all the compilation problems yourself, some hints for older GMP versions are here:
    • https://cs.nyu.edu/exact/core/gmp/
    • http://www.blizzhackers.cc/viewtopic.php?t=393933


来源:https://stackoverflow.com/questions/47359417/how-to-compile-gmp-for-windows-using-visual-studio

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!