Hi,
I am trying to convert a processing project of mine to openFrameworks. I ran into a strange error that I couldn’t debug. So I tried to build my class from the ground up and I run into the same error again when I try to use a vector that I declared inside the .h file.
#ifndef __interactivePlants__ofBranch__
#define __interactivePlants__ofBranch__
#include "ofMain.h"
class ofBranch {
public:
void update();
void draw();
ofBranch(float x, float y);
private:
vector<ofVec2f> joints;
};
#endif
the corresponding .cpp file:
#include "ofBranch.h"
ofBranch::ofBranch(float x, float y) {
ofVec2f origin;
origin.x = x;
origin.y = y;
joints.push_back(origin);
}
void ofBranch::update() {
}
void ofBranch::draw() {
}
now, if I remove the vector declaration from the .h file, and move it inside the constructor itself, it runs smoothly. Yet, I want to access this vector in a the update() later on. I have a feeling I am missing something very obvious.