Problem compiling Unknown symbol from compiler in CUDA

I get an error CUDA compiling my code:

ptxas C:\DOCUME~1\Alec\LOCALS~1\Temp/tmpxft_00000c3c_00000000-6.ptx, line 985; error : Unknown symbol ‘__T237’

The kernel which produces the error is just a simple one to help me learm my way around textures etc. The line which appears to cause the error is the call on tex2D.

Windows XP, Microsoft Visual Studio 7.

global void doCopyUsingTexture (size_t width, size_t height, texture<short4, 2, cudaReadModeElementType> texRef, void* dest, size_t destPitch, int offset)
{

size_t colNumber = offset + threadIdx.x;
size_t destStride = destPitch / sizeof (short4) ;
short4* pDest = (short4*) dest + colNumber ;
for (size_t i = 0 ; i < height ; i++)
	{
	short4 val = tex2D (texRef, colNumber, height) ;
	*pDest = val ;
	pDest += destStride ;
	}
}

Any suggestions?

Thanks

Alec

AFAIK texture cannot be passed as function parameter.
GUDA gurus pls correct me if I am wrong.

Texture references must be declared globally and only exist in one .cu file. This is not very clearly stated in the programming guide.