Please suggest me a hint over here:
class UIClass
{
public:
UIClass::UIClass();
};
#ifndef __PLATFORM__
#define __PLATFORM__
UIClass Platform;
#else
extern UIClass Platform;
#endif
I'm including this two times and getting:
LNK2005 - Platform already defined in .obj (MSVS13).
As you can guess, the idea was to define Platform only once. Why does #ifndef
or #define
fail? How should I fix this?