So I have two files, baseline.h
and baseline.cpp
. In baseline.h
, I have created a class that declares multiple functions and variables, with a sample of one here:
#pragma once
class entity
{
protected:
int x;
int y;
public:
void spawn(int bx, int by);
}
baseline.cpp
tries to define the function as such:
#include "baseline.h"
void entity::spawn(int bx, int by)
{
x = //functionality
y = //functionality
}
I keep being met with the same errors: 'entity': is not a class or namespace name
, followed by 'x': undeclared identifier
and 'y': undeclared identifier
.
Am I missing something incredibly obvious here?