|
-
May 1st, 2009, 10:40 PM
#1
Help need with c++ forward declarations
I am new to using forward declarations. I thought I had understood quite a bit of it until I got this error. Seems there is something really really basic that I miss. can some one of you help me with this error???
src/BaseBodyDynamics.cpp:15: error: invalid use of incomplete type 'struct Xlib::Quatf'
include/BaseBodyDynamics.h:19: error: forward declaration of 'struct Xlib::Quatf'
basically i tried forward declaring the class Quat . Then had a variable declared in the header file which was a pointer. When i try using the variable in the cpp file after including Quaternion.h which is the parent file of Quat I get this error.
A small code snippet
Code:
//Header file
class *Quat;
Quatf* m_qSObjectSpin;
//cpp file
m_qSObjectSpin->normalize();
Actually the quaternion is a part of the struct i have defined in my class..I am not sur eif that is causing the error or if there is any better way to do this.
Cheers
-
May 2nd, 2009, 12:07 AM
#2
Re: Help need with c++ forward declarations
header file...
Code:
class CObject;
class CObjectManager {
public:
CObject *m_ptrObjects;
int m_numObjects;
};
source file...
Code:
#include "ObjectManager.h"
#include "Object.h"
...
-
May 2nd, 2009, 06:22 AM
#3
Re: Help need with c++ forward declarations
It seems I have given exactly the same format in the header file and the cpp file as told above.. But still i get the same error
src/BaseBodyDynamics.cpp:15: error: invalid use of incomplete type 'struct Xlib::Quatf'
include/BaseBodyDynamics.h:19: error: forward declaration of 'struct Xlib::Quatf'
Can someone help me with this
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|