Class modelling with .cu files

Hi people,

I’m having some difficults with class modelling.

I’m using Visual Studio 2005 and CUDA VS Wizard 2.0. It’s very strange since the first code posted below works, but the second one doesn’t, giving the next linking error:

“error LNK2001: unresolved external symbol __Znwj”

Code that works:

#include <stdio.h>

#include <stdlib.h>

#include <cuda_runtime.h>

#include <cutil.h>

class Solution

{

public:

	Solution(){}

	

	void helloWorld(){

		printf("Hello World\n");

	}

};

int main(int argc, char* argv[])

{

	Solution s = Solution();

	s.helloWorld();

	getchar();

	return 0;

}

Code that doesn’t work:

#include <stdio.h>

#include <stdlib.h>

#include <cuda_runtime.h>

#include <cutil.h>

class Solution

{

public:

	Solution(){}

	

	void helloWorld(){

		printf("Hello World\n");

	}

};

int main(int argc, char* argv[])

{

	Solution* s = new Solution();

	s->helloWorld();

	getchar();

	return 0;

}

Both work if extension is .cpp, but the second doesn’t if it’s .cu. What am I missing here?

Sorry for the double post, but I’ve discovered it’s not CUDA Wizard 2.0’s fault. It seems --deviceemu doesn’t let me class modelling with the

Solution* s = new Solution();

code. It gives errors in linking. But if I try on a real CUDA hardware, without the --deviceemu option, it will compile and execute correctly.

Could somebody check this?