问题
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