- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I created this source code in file Test_mod.f90
Module Test_mod
INTEGER :: I1 = 10
INTEGER :: I2 = 20
REAL :: R1 = 1.234
REAL :: PI = 3.14159
END MODULE
Compiled it, and moved the file to b:\ivfprojects\ModFiles.
Then I created this source code in file UseModTest.f90:
PROGRAM USEMODTEST
USE Test_mod
IMPLICIT NONE
PRINT *, 'I1 =', I1
PRINT *, 'I2 =', I2
END PROGRAM
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 12.1.2.278 [IA-32]...
1>UseModTest.f90
1>Linking...
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?
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page