rockdale
2010-10-11 16:11:10 UTC
Hi, All:
I am stuck on this C2491 error when I converter a vs6.0 project into
VS2010. See extracted code below:
in .h
#ifdef MY_API_EXPORTS
#define MY_API __declspec(dllexport)
#else
#define MY_API __declspec(dllimport)
#endif
CString MY_API MyFunc();
in .cpp
CString MY_API MyFunc()
{
return "teststring";
}
It build successfully in vs6.0, but after convert to vs2010, I got the
erroe:
error C2481: definition of dllimport not allowed on line CString
MY_API MyFunc() in .cpp file.
I read about this error in msdn and think my usage should be correct,
obvious I am missing something, where should I start to look into?
Thanks in advance
-Rockdale
I am stuck on this C2491 error when I converter a vs6.0 project into
VS2010. See extracted code below:
in .h
#ifdef MY_API_EXPORTS
#define MY_API __declspec(dllexport)
#else
#define MY_API __declspec(dllimport)
#endif
CString MY_API MyFunc();
in .cpp
CString MY_API MyFunc()
{
return "teststring";
}
It build successfully in vs6.0, but after convert to vs2010, I got the
erroe:
error C2481: definition of dllimport not allowed on line CString
MY_API MyFunc() in .cpp file.
I read about this error in msdn and think my usage should be correct,
obvious I am missing something, where should I start to look into?
Thanks in advance
-Rockdale