0

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.

francescalus
  • 30,576
  • 16
  • 61
  • 96
Charles
  • 947
  • 1
  • 15
  • 39

1 Answers1

3

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).

Community
  • 1
  • 1
Peter Petrik
  • 9,701
  • 5
  • 41
  • 65
  • very simple and helpful answer. And it turns out that I can even just include the path before each file if I want. One difficulty though was that was running into errors with the "/" character, since it indicates when options are used. Thank you @Peter! – Charles May 13 '14 at 01:23
  • Also, @Peter, might you know why this doesn't work? : – Charles May 13 '14 at 03:01
  • df magneticField /exe:magneticField /include:..\FORTRAN_LIB\ __constants myIO griddata_mod myfdgen myDiff – Charles May 13 '14 at 03:01
  • It turns out that this is not actually working for me, from my comment above, my path is somehow not being found. – Charles May 13 '14 at 21:38
  • I would say this is an answer to your question about not found `-i` flag. Post another question or do some research if you have another issue. Quite unclear what your problem is from the comments – Peter Petrik May 14 '14 at 06:43
  • I did post another question, here: http://stackoverflow.com/questions/23642360/compiling-and-linking-to-used-modules-in-external-directory-compaq-fortran-comma – Charles May 14 '14 at 15:34
  • Although I don't get an error using /include[:dir], it doesn't seem to do anything... I'll check this solution once the other question is answered, because reading the compiler manual was definitely a helpful start, but I don't feel like this solves my problem – Charles May 14 '14 at 15:36