C++ 使用 Visual Studio 构建 GMP 库?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1017058/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Building GMP library with Visual Studio?
提问by ToastedSoul
Is there an easy way to build the GMP (GNU Multiple Precision Arithmetic Library, http://gmplib.org) under Windows, using Visual Studio 2005? I tried to find information about building the library myself, but could not find anything that really helped me. I'm not very experienced with building libraries myself (I've managed to build boost, but that's about it).
是否有一种简单的方法可以使用 Visual Studio 2005 在 Windows 下构建 GMP(GNU 多精度算术库,http://gmplib.org)?我试图找到有关自己构建图书馆的信息,但找不到任何真正对我有帮助的信息。我自己在构建库方面并不是很有经验(我已经设法构建了 boost,但仅此而已)。
Or is there a stable (pre-built) GMP distribution that I'm unaware of?
或者是否有我不知道的稳定(预建)GMP 发行版?
Is MPIR a valid alternative (http://www.mpir.org)? Comment about MPIR on the GMP site: This "angry GMP fork" might be an alternative to the real GMP for some Windows users, but they'll have to deal with lots of anti-GMP sentiments.
MPIR 是一个有效的替代方案 ( http://www.mpir.org) 吗?在 GMP 网站上对 MPIR 的评论:对于某些 Windows 用户来说,这个“愤怒的 GMP 叉子”可能是真正 GMP 的替代品,但他们将不得不处理大量的反 GMP 情绪。
Edit:The MPFR C++ wrapper page contains information/links to GMP/MPFR solutions for Visual Studio and compiled gmp/mpfr libraries as well: http://www.holoborodko.com/pavel/mpfr/
编辑:MPFR C++ 包装器页面包含 Visual Studio 的 GMP/MPFR 解决方案的信息/链接以及编译的 gmp/mpfr 库:http: //www.holoborodko.com/pavel/mpfr/
回答by ToastedSoul
MPIR is a valid alternative. Basically, the GMP folk didn't want to support building on Windows at all. Brian Gladman, as you can see, supported GMP building on Windows for a while. However, eventually he and others forked GMP and created MPIR. That wasn't the sole reason but it was a large driving factor and one of the key development principles of MPIR is it must build on Windows (as well as Linux and Mac).
MPIR 是一个有效的替代方案。基本上,GMP 人员根本不想支持在 Windows 上构建。正如您所见,Brian Gladman 支持在 Windows 上构建 GMP 有一段时间了。然而,最终他和其他人分叉了 GMP 并创建了 MPIR。这不是唯一的原因,但它是一个很大的驱动因素,MPIR 的关键开发原则之一是它必须建立在 Windows(以及 Linux 和 Mac)上。
回答by Ali Sharif
If you want to quickly get started with GMP on windows, I've shared a my Visual Studio project which uses prebuilt GMP: https://stackoverflow.com/a/38176221/1327178.
如果您想在 Windows 上快速开始使用 GMP,我已经分享了我的 Visual Studio 项目,它使用预构建的 GMP:https: //stackoverflow.com/a/38176221/1327178。