upgrading to CUDA 2.0 (XP) External symbol error

I just upgraded to cuda 2.0 Beta and noticed a few errors when compiling. Most I was able to fix but this I cannot figure out.

I get the following errors:

ImLocR and ImLocL are char* that I am sharing between my main.cpp and .cu files. What I am doing is allocating pinned memory on the .cu side and then streaming images to that memory pointer using opencv on the .cpp side. This works fine in Cuda 1.1

My main.cpp has the following format:

extern "C" char* ImLocL;

extern "C" char* ImLocR;

extern "C" void cMalloc(); //this is where I allocate pinned memory

int main(int argc, char** argv)

{

IplImage *imGreyL = new IplImage; //opencv image type

	IplImage *imGreyR = new IplImage;

	cMalloc();

	imGreyL = cvCreateImage( cvGetSize(imOrigR), 8, 1);

	imGreyR = cvCreateImage( cvGetSize(imOrigR), 8, 1);

	imGreyL->imageData=ImLocL;

	imGreyR->imageData=ImLocR;

       ...

}

and my .cu file looks like:

char *ImLocL;

char *ImLocR;

extern "C" void cMalloc()

{

	CUDA_SAFE_CALL(cudaMallocHost((void**) &ImLocL,1024*768*sizeof(char)));

	CUDA_SAFE_CALL(cudaMallocHost((void**) &ImLocR,1024*768*sizeof(char)));

}

Does anybody have a suggestion on why this would change going from cuda 1.1 -> 2.0 or any suggestions on how to fix this or perhaps an alternate way to get the same effect.

Thanks!

For anybody in the future that has the same problem I fixed this by removing the “C” in the ‘extern “C”’ in the .cpp file and everything works fine for Cuda 2.0 beta.