Hi guys
I had a post going sometime before this error .. But could nt follow up on it.. Pardon me for that.. I am trying to do a bit of forward declarations in my program and wrote a couple of classes but then I run into this error which I do not seem to solve
src/BaseBodyDynamics.cpp: In member function 'void Xlib::BaseDynamics::State::RecalculateState()':
src/BaseBodyDynamics.cpp:15: error: invalid use of incomplete type 'struct Xlib::Quatf'
include/BaseBodyDynamics.h:21: error: forward declaration of 'struct Xlib::Quatf'
Pardon me if it is somethin trivial but then it would be nice for someone to chip in with a answer to why this is happening
..
I jus compiled all the code that I thought could be causing the error..
Code://test.h class Quatf; class Test{ //ctor Test(); //dtor ~Test() ; public: struct state{ Quatf* myvariable; void recalculate(); } }Code://test.cpp #include "test.h" void Test::state::recalculate(){ myvariable-> }I hope some one can helpCode://Quaternion.h template < class T> class Quat { T x; T y; T z; T w; Quat(T _x, T _y,T _z, T _r) : x (_x),y(_y),z(_z),w(_w){} Quat<T>& normalize(); T length(); }; inline Quat<T>& Quat<T>::normalize() { if ( T l = length() ) { r /= l; v /= l; } return *this; } inline T Quat<T>::length() { return sqrt(x*x+y*y+z*z+w*w); } typedef Quat<float> Quatf;




Reply With Quote
