我有一个名为 Video 的类,定义如下:
class Video
{
public:
Video() { }
~Video()
{
}
unsigned int m_max_ad_duration;
unsigned int m_max_skippable_duration;
unsigned int m_start_delay;
unsigned short int m_inventory_type;
unsigned short int m_skippable_Request;
};
如果我在一个名为 Video.h 的新文件中有上述内容,则构建工作正常,但是当我在包含许多类的现有文件中声明上述内容时,构建失败并出现错误,例如
../../include/CampaignCache.h:33:56: error: ‘Video’ was not declared in this scope
../../include/CampaignCache.h:33:62: error: template argument 1 is invalid
../../include/CampaignCache.h:33:62: error: template argument 2 is invalid
../../include/CampaignCache.h:33:64: error: template argument 2 is invalid
../../include/CampaignCache.h:33:64: error: template argument 5 is invalid
../../include/CampaignCache.h:33:89: error: invalid type in declaration before ‘;’ token
../../include/CampaignCache.h:97:51: error: ‘Video’ has not been declared
make[2]: *** [BaseOpenRTBBidRequest.o] Error 1
make[2]: Leaving directory `/home/asif/RTB3.0trunk/trunk/3.0/src/bidder/ssp/OpenRTB'
make[1]: *** [OpenRTB] Error 2
make[1]: Leaving directory `/home/asif/RTB3.0trunk/trunk/3.0/src/bidder'
make: *** [compile] Error 2
理想情况下,我希望文件中的 Video 类带有子类,有人可以解释为什么一个会导致构建错误而另一个不会?