T
thatsme
I'm trying to access static data member through static function. Here is the
source
class Something
{
private:
static int s_nValue;
public:
static int GetValue() { return s_nValue; }
};
int Something::s_nValue = 1;
#include <iostream>
#include "Something.h"
int main()
{
std::cout << Something::GetValue() << std::endl;
return 0;
}
I'm using MS Visual studio and I keep getting these errors:
error LNK2019: unresolved external symbol _WinMain@16 referenced in function
___tmainCRTStartup MSVCRTD.lib test
fatal error LNK1120: 1 unresolved externals C:\***
source
class Something
{
private:
static int s_nValue;
public:
static int GetValue() { return s_nValue; }
};
int Something::s_nValue = 1;
#include <iostream>
#include "Something.h"
int main()
{
std::cout << Something::GetValue() << std::endl;
return 0;
}
I'm using MS Visual studio and I keep getting these errors:
error LNK2019: unresolved external symbol _WinMain@16 referenced in function
___tmainCRTStartup MSVCRTD.lib test
fatal error LNK1120: 1 unresolved externals C:\***