Error LNK2019



Hi everybody,
I'm using IVF 9.1 with MSVS 2005 and I'm experiencing a strange
problem. I've got a program composed by several subroutines (each in a
different file) and it works very well. Now I'm trying to merge all
the code in a single file and I receive this message

1>------ Inizio generazione: Progetto: AIEM - single scattering -
final, Configurazione: Debug Win32 ------
1>Compiling with Intel Fortran 9.1 C:\Programmi\Intel\Compiler\Fortran
\9.1\IA32\...
1>AIEM_final.F90
1>ifort: Command line warning: overriding '/Qvc7.1' with '/Qvc8'
1>Linking...
1>AIEM_final.obj : error LNK2019: riferimento al simbolo esterno
_D_ERFC non risolto nella funzione _B6
1>Debug/AIEM - single scattering - final.exe : fatal error LNK1120: 1
esterni non risolti
1>
1>Build log written to "file://C:\Documents and Settings\Decsar
\Documenti\Fortran\AIEM - single scattering - final\Debug
\BuildLog.htm"
1>AIEM - single scattering - final build failed.
1>
========== Generazione: 0 completate, 1 non riuscite, 0 aggiornate, 0
ignorate ==========


The function with the problem is



DOUBLE PRECISION function Shadowing_single(a)
USE costanti_AIEM, ONLY : pi, k1, sds, theta_s, theta_i, L
!USE IMSL_LIBRARIES
USE ERFC_INT
implicit none


DOUBLE PRECISION :: a, lambda_S, lambda_I, sds1

sds1=dsqrt(2d0*(sds/L)**2d0)

lambda_S=0.5d0 * (dsqrt(2d0/pi) * sds1 * dtan(theta_s) * dexp(-1d0/
(2d0*(sds1**2d0)*(dtan(theta_s))**2d0) ) )&
-(erfc(1d0/(dsqrt(2d0)*sds1*dtan(theta_s))))

lambda_I=0.5d0 * (dsqrt(2d0/pi) * sds1 * dtan(theta_i) * dexp(-1d0/
(2d0*sds1**2d0*(dtan(theta_i))**2d0) ) )&
-(erfc(1d0/(dsqrt(2d0)*sds1*dtan(theta_i))))


Shadowing_single = 1d0/( lambda_S+lambda_I+1d0 )

return
end function


Sometimes I receive this kind of message even when I switch from
single to double precision.
I'm a newby and I don't know if this is a stupid problem or not.

Does someone knows the solution?

Marco

.