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?