I am including 'controlPointsEditorDlg.h' in 'meshparameterdlg.h' and
'meshparameterdlg.h' in 'controlPointsEditorDlg.h'
This is rather bad idea. What you have to do is to include at least one of these headers to the .cpp file, for example imagine 4 files: a.h, a.cpp, b.h, b.cpp - with classes A and B.
If you want to have in class A a pointer member to class B you have to use "forward declaration":
a.h:
#ifndef A_H
#define A_H
class B;
class A
{
B *b;
};
#endif
#ifndef A_H
#define A_H
class B;
class A
{
B *b;
};
#endif
To copy to clipboard, switch view to plain text mode
a.cpp:
#include "a.h"
#include "b.h"
// . . . some code for class A using class B as well
#include "a.h"
#include "b.h"
// . . . some code for class A using class B as well
To copy to clipboard, switch view to plain text mode
b.h
#ifndef B_H
#define B_H
class A;
class B
{
A *a;
};
#endif
#ifndef B_H
#define B_H
class A;
class B
{
A *a;
};
#endif
To copy to clipboard, switch view to plain text mode
b.cpp
#include "a.h"
#include "b.h"
// . . . some code for B using A as well
#include "a.h"
#include "b.h"
// . . . some code for B using A as well
To copy to clipboard, switch view to plain text mode
You can do it for just A or just B not for both and it should ok too. The only thing is that when you use forward declaration you can only use the pointer to the forward declared class, you can't use the whole object, so this is wrong:
class A;
class B
{
A a;
};
class A;
class B
{
A a;
};
To copy to clipboard, switch view to plain text mode
if you don't include a.h.
Bookmarks