I am trying to use the ofxVectorMath addon. I used the command “ofProject create ofSandbox” to create the project, which works fine. I then added the VectorMath library by running the command “ofProject add ofSandbox ofxVectorMath”
When I open the project up in Code Blocks, I see ofxVectorMath in the addon’s folder
I included the ofxVectorMath.h in the testApp.h using this line:
#include “ofxVectorMath.h”
if i add
ofxVec3f myVector;
to testApp.h directly underneath the window event function declarations (windowResized, mouseMoved, etc) I get this error when I build:
undefined reference to `ofxVec3f::ofxVec3f(float, float, float)’
The vectorMathExample project builds and runs fine, I have even tried copying the testApp.cpp and .h file contents directly, and just get a series of similar errors.
What am I missing? I realize I could probably just copy the vectorMathExample and do the renames, but I would prefer to understand whats going on.
For reference here is my testApp.h file:
#ifndef _TEST_APP
#define _TEST_APP
#include “ofMain.h”
#include “ofxVectorMath.h”
class testApp : public ofBaseApp{
public:
void setup();
void update();
void draw();
void keyPressed (int key);
void keyReleased (int key);
void mouseMoved(int x, int y );
void mouseDragged(int x, int y, int button);
void mousePressed(int x, int y, int button);
void mouseReleased(int x, int y, int button);
void windowResized(int w, int h);
ofxVec3f myVector;
};
#endif