IgorStravinsky
asked on
General C++ Question...
Hello experts exchange
I have a C++ program like so:
header1.h
--------- cut
#ifndef FOO1H
#define FOO1H
#include "Foo2.h"
class Foo1
{ void Func (Foo2 *);
};
#endif
--------- end
header2.h
--------- cut
#ifndef FOO2H
#define FOO2H
#include "Foo1.h"
class Foo2
{ void Func (Foo1 *);
};
#endif
--------- end
--------- Then their respective cpp files with function definitions etc...
This is resulting in compiling errors, mainly "Syntax" errors. Should this happen? If so, how do I correct it? I can get around it by including (essentially) "Foo2.h" in "Foo1.cpp" and then taking a void * parameter instead, but this is messy. I want a good solution.
I have a C++ program like so:
header1.h
--------- cut
#ifndef FOO1H
#define FOO1H
#include "Foo2.h"
class Foo1
{ void Func (Foo2 *);
};
#endif
--------- end
header2.h
--------- cut
#ifndef FOO2H
#define FOO2H
#include "Foo1.h"
class Foo2
{ void Func (Foo1 *);
};
#endif
--------- end
--------- Then their respective cpp files with function definitions etc...
This is resulting in compiling errors, mainly "Syntax" errors. Should this happen? If so, how do I correct it? I can get around it by including (essentially) "Foo2.h" in "Foo1.cpp" and then taking a void * parameter instead, but this is messy. I want a good solution.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER