[使用VS2015在Windows 10上构建Fortran .lib x64位并将其链接到C ++

问题描述 投票:0回答:1

[我正在使用VS2015构建c ++和Fortran混合程序,在Windows 7上非常好。首先构建了Fortran XXX.lib,然后将其链接到C ++ XXX_main(构建依赖项->项目依赖项)。现在,我尝试将其迁移到具有目标计算机x64的Windows 10,但仍使用VS2015,并且存在编译错误,经过数周的搜索,我找不到解决方案。

这里是编译信息:

------ Neues Erstellen gestartet: Projekt: XXX, Konfiguration: Debug x64 ------
1>Deleting intermediate files and output files for project 'XXX', configuration 'Debug|x64'.
1>Compiling with Intel(R) Visual Fortran Compiler 19.0.5.281 [Intel(R) 64]...
1>scout2d.f
1>E:\test\src\scout2d.f(74): error #8110: The module file for compiler-generated interface was generated for a different platform or by an incompatible compiler or compiler release. It cannot be read. Use -gen-interfaces option.   [XGET__GENMOD]
1>fortcom: Fatal: There has been an internal compiler error (C0000005).
1>compilation aborted for E:\test\src\scout2d.f (code 1)
...........
1>scp_lib - 82 error(s), 18 warning(s)
1>XXX - 82 error(s), 18 warning(s)
2>------ Neues Erstellen gestartet: Projekt: XXX_main, Konfiguration: Debug x64 ------
...........
2>  XXX_main.vcxproj -> E:\test\x64\Debug\XXX_main.exe
2>  XXX_main.vcxproj -> E:\test\x64\Debug\/XXX_main.pdb (Full PDB)
========== Alles neu erstellen: 1 erfolgreich, 1 fehlerhaft, 0 übersprungen ==========

源文件当然与Windows 7上的文件相同。这是我在Windows 10上使用VS2015对x64系统进行的更改。欢迎任何建议。谢谢!

  1. XXX_main项目属性->链接器->输入->其他依赖项和库:与以前相同
  2. XXX_main项目属性-> C ++->包含文件夹:与以前相同
  3. XXX_main项目属性->链接器->高级->目标计算机:将MachineX84更改为MachineX64
  4. 配置管理器->平台:x64
  5. 选项->英特尔编译器和工具-> C ++->编译器:将win32更改为x64
  6. 选项->英特尔编译器和工具-> Visual Fortran->编译器->包括:添加$(IFORT_COMPILER15)\ compiler \ include->库:添加$(IFORT_COMPILER15)\ compiler \ lib \ intel64
  7. 卸载和重新安装Fortran编译器,当前版本为:英特尔(R)Visual Fortran英特尔(R)64编译器,用于在英特尔(R)64版本19.0.5上运行的应用程序]
  8. Visual Studio 2015的卸载和新安装,当前版本为14.0.25431.01更新3
  9. [Fortran XXX项目属性->库->输出:x64 \ Debug \ XXX.lib

我正在使用VS2015构建c ++和Fortran混合程序,这在Windows 7上非常完美。首先构建了Fortran XXX.lib,然后将其链接到C ++ XXX_main(构建依赖项->项目...

c++ windows visual-studio fortran 64-bit
1个回答
0
投票

我已经找到了解决方案。这是我所做的:

© www.soinside.com 2019 - 2024. All rights reserved.