Building GMP library with Visual Studio?

倖福魔咒の 提交于 2019-11-27 01:58:07

问题


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).

Or is there a stable (pre-built) GMP distribution that I'm unaware of?

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.

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/


回答1:


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).




回答2:


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.



来源:https://stackoverflow.com/questions/1017058/building-gmp-library-with-visual-studio

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