Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Error LNK 2001

jin_li
Beginner
381 Views
Hi, I have a problem in using module. I have a simple module defined as

module BasicConstants
real*8 :: pi=3.141592653589793d0
end module BasicConstants

and I tried to use parameter pi in another subroutine

subroutine read_postscript_input
use BasicConstants
....
psview%psi=psview%psi/180*pi
.....
end subroutine read_postscript_input

and i get following error message at compiling

"/out:..\\exe_release\\ps.dll" "..\\exe_release\\cover_ps.lib" "..\\exe_release\\toolbox.lib" /dll "..\\exe_release\\ps.obj"
Creating library ..\\exe_release\\ps.lib and object ..\\exe_release\\ps.exp
ps.obj : error LNK2001: unresolved external symbol _BASICCONSTANTS_mp_PI
..\\exe_release\\ps.dll : fatal error LNK1120: 1 unresolved externals
NMAKE : U1077: 'link' : return code '0x460'
Stop.

Could someone help me out here?
I must have missed some simple things.

Thx,

Jin Li
0 Kudos
1 Reply
Steven_L_Intel1
Employee
381 Views
Since you're using NMAKE, I assume you wrote your own makefile. You must also link in the .obj created by the compilation of module BasicConstants.
0 Kudos
Reply