2013-02-18 69 views
0

内我有一个名为视频类,并定义为以下几点:C++类没有范围

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 

我非常希望与子类的文件中的视频类的现有文件,上面有人可以解释为什么一个会导致生成错误和其他不?

+0

请正确格式化您的代码。 – Arpit 2013-02-18 17:20:50

+4

看起来像一个通告包含问题。 – 2013-02-18 17:22:15

+0

如果问题是由于循环包含引起的,并且您想知道为什么包括警卫不提供帮助(假设您使用它们),[本问答](http://stackoverflow.com/questions/14909997/why-arent-my -include-guards-preventing-recursive-inclusion-and-multiple-symbol)可能会帮助你理解发生了什么。 – 2013-02-18 17:42:27

回答

0

我只是简单地把视频类放在一个独立的文件,并开始工作正常