我有这个头文件:
//region.hpp
#ifndef REGION_HPP
#define REGION_HPP
...
#include "spacepoint.hpp"
class Image;
//class SpacePoint;
class Region
{
Rectangle<SpacePoint> boundaries;
...
它给出了这个错误
error: ‘SpacePoint’ was not declared in this scope
当我取消注释时,class SpacePoint
我得到了这个:
In instantiation of ‘class Rectangle<SpacePoint>’:
region.hpp:15:27: required from here
rectangle.hpp:19:7: error: ‘Rectangle<T>::start’ has incomplete type
我试图用一个较小的测试程序重现这个问题,但我不能。
我不知道如何解决这个问题。