首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在VisualStudio 2013中包含Fortran中的文件

在VisualStudio 2013中包含Fortran中的文件
EN

Stack Overflow用户
提问于 2015-06-23 15:52:51
回答 1查看 851关注 0票数 0

我的问题是无法在VisualStudio 2013中包含文件。

我可以做这个程序,它按它应该的方式工作:

Console5.f90不包含:

代码语言:javascript
复制
program Console5
implicit none
! Variables    
integer, parameter :: IDC_3D                          = 11
integer, parameter :: IDC_Contour                     = 22
integer, parameter :: IDC_TimeHist                    = 33
integer, parameter :: IDC_ContLev                     = 44

! Body of Console5
print *, 'Hello World'
print *, IDC_3D
print *, IDC_Contour  
end program Console5

但是,当我将变量放在另一个文件Ami.fd中并将其包含在"Console5“中时,我得到了错误#5102: Cannot open include file Ami.fd

Ami.fd:

代码语言:javascript
复制
  integer, parameter :: IDC_3D                          = 111
  integer, parameter :: IDC_Contour                     = 222
  integer, parameter :: IDC_TimeHist                    = 333
  integer, parameter :: IDC_ContLev                     = 444

Console5.f90包括:

代码语言:javascript
复制
program Console5
implicit none    
include 'Ami.fd'
! Body of Console5
print *, 'Hello World'
print *, IDC_3D
print *, IDC_Contour   
end program Console5

有人知道为什么吗?

EN

回答 1

Stack Overflow用户

发布于 2015-06-23 20:17:43

默认情况下,编译器将在与源文件相同的目录中查找包含文件。确保ami.fd位于该目录中。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/30996936

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档