Garmaine Staff asked 2 years ago
This question already has answers here:
Closed 11 hours ago.

Trying to compile:

Glider.h:

class Glider
{
public:

static int RuleNumber;

static void SetRuleNumber(const int RuleNmb);
};

Glider.cpp:

#include "Glider.h"

void Glider::SetRuleNumber(const int RuleNmb)
{
Glider::RuleNumber=RuleNmb;
return;
};

Produces:

1>Glider.cpp
1>Glider.obj : error LNK2001: unresolved external symbol "public: static int Glider::RuleNumber" (? 
RuleNumber@Glider@@2HA)
fatal error LNK1120: 1 unresolved externals

What is wrong with this code? Can't figure it out. Using newest Visual Studio.