【发布时间】:2010-06-09 14:12:58
【问题描述】:
我在 , or 之前得到一个“预期的类名;我不太明白如何解决它。
这里是错误的地方:
class FXHost : public CPLAT::CP_Application, public CPLAT::CP_M_Listener
{
该文件是 FXHost.h,而 CPLAT:: 显然是 CP_Application 和 CP_M_Listener 所在的命名空间。
我不明白为什么这是错误的。这段代码在 Metrowerks 中运行良好(没有 CPLAT::),但在 XCode 中,由于之前的开发人员编写代码的方式,需要 CPLAT。
谁能解释一下这个错误?
更新:这是 CP_Application 类的示例
template <class DOC_POLICY, class PRINT_POLICY, class UNDO_POLICY>
class CP_EXPORT CP_Application : public CP_Application_Imp
{
public:
typedef DOC_POLICY DocPolicyType;
typedef PRINT_POLICY PrintPolicyType;
typedef UNDO_POLICY UndoPolicyType;
CP_Application();
virtual ~CP_Application() throw();
【问题讨论】:
-
听起来好像缺少声明 CPLAT:: 类的 #include。
标签: c++ class namespaces compiler-errors