I created this source code in file Test_mod.f90
INTEGER :: I1 = 10
INTEGER :: I2 = 20
REAL :: R1 = 1.234
REAL :: PI = 3.14159
Compiled it, and moved the file to b:\ivfprojects\ModFiles.
Then I created this source code in file UseModTest.f90:
PRINT *, 'I1 =', I1
PRINT *, 'I2 =', I2
Using visual Studio, I set the project properties > Fortran > Additional include directories to : "b:\ivfprojects\ModFiles".
The source file compiles OK but it will not link: fatal error LNK1120: 2 unresolved externals
1>Debug\ModCallingTest.exe : fatal error LNK1120: 2 unresolved externals. (The complete build log is attached) Sorry, buildlog.htm would not upload. Here is the text: (sorry about the formatting, I can't figure out how to control it)
1>------ Rebuild All started: Project: ModCallingTest, Configuration: Debug Win32 ------
1>Deleting intermediate files and output files for project 'ModCallingTest', configuration 'Debug|Win32'.
1>Compiling with Intel(R) Visual Fortran Compiler XE 220.127.116.118 [IA-32]...
1>UseModTest.obj : error LNK2019: unresolved external symbol _TEST_MOD_mp_I2 referenced in function _MAIN__
1>UseModTest.obj : error LNK2019: unresolved external symbol _TEST_MOD_mp_I1 referenced in function _MAIN__
1>Debug\ModCallingTest.exe : fatal error LNK1120: 2 unresolved externals
I thought this was supposed to work and followed instructions as carefully as I could. What is wrong?