I have 2 .f90 files.
module definedmod integer :: a = 4 end module definedmod
program usemod use definedmod print *, a end program usemod
I succeeded in compiling the module definition file using this command:
ifort -c mod_def.f90
THis generated a .obj and .mod file which is good. However when I try to compile the main program
I get a big error
Intel(R) Visual Fortran Intel(R) 64 Compiler XE for applications running on Inte
l(R) 64, Version 184.108.40.206 Build 20121008
Copyright (C) 1985-2012 Intel Corporation. All rights reserved.
Microsoft (R) Incremental Linker Version 10.00.30319.01
Copyright (C) Microsoft Corporation. All rights reserved.
use_mod_def.obj : error LNK2019: unresolved external symbol DEFINEDMOD_mp_A refe
renced in function MAIN__
use_mod_def.exe : fatal error LNK1120: 1 unresolved externals
How do I compile the main program and have it recognize the use module?
As a side notes the online help docs don't provide a working example. They only gloss over some generalities. It would be good to have working examples that users can copy, paste and work with...
Thanks and look forward to your responses.
Nevermind I got it from this thread https://software.intel.com/en-us/forums/intel-visual-fortran-compiler-for-windows/topic/290070
what I did was:
>ifort -c mod_def.f90
>ifort use_mod_def.f90 mod_def.obj
Then I got the executable.