Answer the question
In order to leave comments, you need to log in
Why am I getting "unresolved external symbol"?
My DLL class needs to have static variables. However, when I try to use them, I get the LNK2001 error.
Here is part of my code:
.h
extern "C" GRAPHICLIBRARY_API int SizeX;
extern "C" GRAPHICLIBRARY_API int SizeY;
extern "C" GRAPHICLIBRARY_API vector<string> Screen;
static class ScreenClass {
public:
__declspec(dllexport) static int SizeX;
public:
__declspec(dllexport) static int SizeY;
public:
__declspec(dllexport) static vector<string> Screen;
public:
__declspec(dllexport) static bool InitializeScreen(int sizeX,int sizeY) {
//Ошибка ссылается на строки ниже:
ScreenClass::SizeX = sizeX;
ScreenClass::SizeY = sizeY;
ScreenClass::Screen.clear();
//.......
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question