[my code is quiet big, so I only pasted parts that seemed relevant to me, just tell me if you need to see more of it, thanks]
I defined a constant in a class (Animation) but now I split the class in two (AnimationsDefinition & AnimationsInstance), I can't use that constant from one class to the other
I included AnimationsDefinition.h before AnimationsInstance.h
common.h
#include "animationsDefinition.h"
#include "animationsInstance.h"
the compiler complains the constant cannot be evaluated
the below code used to be working, but now I use it in another class, it does not work anymore
the error I get :
error C2131: expression did not evaluate to a constant
note: failure was caused by non-constant arguments or reference to a non-constant symbol
note: see usage of 'EAST'
AnimationsDefinition.cpp
#include "common.h"
const int AnimationsDefinition::WEST = 0;
const int AnimationsDefinition::SOUTH = 1;
const int AnimationsDefinition::NORTH = 2;
const int AnimationsDefinition::EAST = 3;
...
AnimationsDefinition.h
#pragma once
class AnimationsDefinition
{
public:
static const int WEST;
static const int SOUTH;
static const int NORTH;
static const int EAST;
...
AnimationsInstance.cpp
#include "common.h"
void AnimationsInstance::update(float tpf)
{
switch (direction)
{
case AnimationsDefinition::EAST: <<<<<<<<< compilation error
{
...
Any help appreciated
regards