объявления классов сначала, потом их реализация:
Unit.hpp
#include "Effect.hpp"
class Unit
{
public:
void f(int x);
protected:
private:
Effect *fx;
};
-----------------------------------
Unit.cpp
#include "Unit.hpp"
void Unit::f(int x)
{
...
}
-----------------------------------
где-то в main.cpp
#include "Unit.hpp"
#include "Effect.hpp"
...
Effect *fx;
Unit *un;
...
fx = new Effect(...);
un = new Unit(...);
fx->setUnit(un);
un->setEffect(fx);
...
delete fx;
delete un;