i have two similar errors which i cannot fix. i have made both classes Model and ModelChangeQueue from the same template as the other classes which are not throwing errors.
ModelChange.h:34: error: ISO C++ forbids declaration of ‘Model’ with no type
ModelChange.h:34: error: expected ‘;’ before ‘*’ token
refers to
Model *model;
in ModelChange.h
and
ModelController.h:52: error: ISO C++ forbids declaration of ‘ModelChangeQueue’ with no type
ModelController.h:52: error: expected ‘;’ before ‘*’ token
refer to
ModelChangeQueue *modelChnageQueue;
in ModelController.h
here is the .h and .ccp code for the ModelChangeQueue because it is has much less than the Model class.
ModelChangeQueue.h
#ifndef _MODEL_CHANGE_QUEUE
#define _MODEL_CHANGE_QUEUE
#include "ofMain.h"
#include "ModelConstants.h"
#include "ModelChange.h"
#include <map>
class ModelChangeQueue {
public:
ModelChangeQueue();
ModelChangeQueue(const ModelChangeQueue&);
void start();
void pause();
void stop();
void add(ModelChange imodelChange);
void add(vector<ModelChange*> imodelChanges);
void update();
int modelChangesIndex;
vector<ModelChange*> modelChanges;
};
#endif
ModelChangeQueue.cpp
#include "ModelChangeQueue.h"
ModelChangeQueue::ModelChangeQueue() {
modelChangesIndex = 0;
}
void ModelChangeQueue::update() {
if(!modelChanges(modelChangesIndex).isChanging) {
modelChangesIndex++;
modelChanges(modelChangesIndex).start();
}
}
void ModelChangeQueue::add(ModelChange imodelChange) {
modelChanges.push_back(imodelChange);
}
void ModelChangeQueue::start() {
modelChanges(modelChangesIndex).start();
}
void ModelChangeQueue::pause() { }
void ModelChangeQueue::stop() { }
thanks!