据我所知,我应该首先安装GMP。我找到的唯一用于此目的的教程是http://cs.nyu.edu/exact/core/gmp/,当我进入步骤3:“打开gmp.dsw (VC++.Net的gmp.vcproj)来构建GMP”时,我收到了许多构建错误。你可以在这里下载:http://www.f2h.co.il/msbz68nzzip。有许多类似于"fatal error C1083: Cannot open include file:'fib_table.h':没有这样的文件或目录“这样的错误。
有没有其他的教程?我该怎么办?
我正在Windows 7上使用Visual Studio 2010。
发布于 2013-11-01 07:54:12
我遇到了类似的问题,并刚刚通过下载预编译的MPIR和MPFR库来解决它,而不是在Windows上需要mingw或类似的GMP。
下面是我的解决方案的链接:How to install MPFR with Visual studio 2008 /2010
希望这对你有所帮助
现在可以在这里找到@casevh提供的完美解决方案:Build mpir/mpfr/mpc via VC++
发布于 2016-07-04 10:36:00
如何使用MPFR设置Visual Studio 2015项目
本指南将帮助您使用MPFR和MPIR (GMP的Windows端口)并使用一些预先构建的二进制文件来启动和运行VS项目。(这里有一个VS项目的链接和我提到的下载的二进制文件:https://www.dropbox.com/s/p08cw59bic4f02v/MPFR-VSProj.zip?dl=1)
获取预编译的二进制文件
从http://www.holoborodko.com/pavel/mpfr/#projects获取
- mpfr\_mpir\_x86\_x64\_msvc2010 (precompiled mpfr mpir with MSVC 2010
由于它是用MSVC2010编译的,因此需要Microsoft Visual C++ 2010 * Redistributable。如果我们试图在调试模式下运行程序,我们将无法运行。我们会得到这样的错误:“程序无法启动,因为MSVCP100.dll在您的计算机中丢失”。本质上,MSVCP100.dll是Visual Studio2010安装的一部分,但不在可再发行包中,它只包含构建的发布版本所需的dll
- NOTE: visual studio still allows one to debug in the Release configuration so debugging isn't a big issue at this stage when you are just trying to get up and running
- mpfrc++-3.6.2 (c++ wrapper by Holoborodko)
注意:这些二进制文件已经有几年的历史了,但它们都经过了测试,并且“相对没有bug”
Visual Studio项目设置:
中缺少调试dll,因此现在必须这样做。
、*.dll、*.exp、*.lib和*.pdb复制到$(SolutionDir)/lib Release头文件中的$(SolutionDir)/include mpfr
- **mpfrc++-3.6.2**
- Add mpreal.h to your project (or in $(SolutionDir)/include if you prefer)
- The header is all you need for the c++ wrapper
- Include Directories: add path to your include directory
- Library Directories: add path to your lib directory
- Add the following to this list: mpfr.lib; mpir.lib;
运行时使用编译器选项更改运行时库:配置属性> C/C++ >代码生成>运行时Library
- select "Multi Threaded DLL (/MD)"
命令命令设置用于生成的编译器参数:配置属性>调试>
- append: "-lmpfr -lgmp"
- Command Line: 'XCOPY "$(SolutionDir)lib\*.dll" "$(TargetDir)" /D /K /Y'
- Description: 'Copy DLLs to Target Directory'
- Use in Build: YES
配置属性->要在清理上删除的常规->扩展
- add: '\*.dll'
示例示例要测试项目,请从mpfrc++-3.6.2文件夹的“
- Make sure to add an include your mpreal.h file after your stdafx.h include
有帮助的文章:
发布于 2020-01-16 18:37:31
使用VCPKG包管理系统应该可以解决您的痛苦。我在windows下使用GNU、libs等的大部分操作都是这样解决的。
https://stackoverflow.com/questions/19688442
复制相似问题