Linking to modules in external directory Compaq Visual Fortran command prompt

不羁的心 提交于 2019-12-11 21:31:02

问题


I know that this question is VERY specific, but I am using "Compaq Visual Fortran Optimizing Compiler, Version 6.5" (Fortran 90). To compile, e.g., I use:

f90 constants.f90 main.f90 /compile_only 

And I'm not sure how to link aside from using the command "DF", but as far as I understand, that compiles AND links AND outputs a .exe to be executed.

My problem is that I have a few modules that I USE in my main program, and I want those modules to be in one folder and my main program to be in another, but, when I try to use directives like -i dir to link the program and the used modules, they don't work and I get the following error:

error: Switch '-i' is ambiguous.

Any help, even just pointing me in the right direction, is greatly appreciated.


回答1:


Read your compiler manual

/[no]include

Syntax:

/include[:path...], /noinclude, or /Ipath

The /include or /I option specifies one or more additional directories (path) to be searched for module files (USE statement) and include files (INCLUDE statement).



来源:https://stackoverflow.com/questions/23598285/linking-to-modules-in-external-directory-compaq-visual-fortran-command-prompt

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