System.h 
static class CSystem  

public: 
static int GetNum(int i); 
CSystem(); 
virtual ~CSystem(); }; System.cpp 
int CSystem::GetNum(int i) 

return i; 
} Exercise.cpp 
void CExerciseDlg::OnBUTTON_GetPID() 

int i = CSystem::GetNum(5); 

提示:
ignored on left of 'class CSystem' when no variable is declared

解决方案 »

  1.   

    c++类的定义没有这种写法的把static去了,然后在Exercise.cpp里面包含#include "System.h 
    "就可以了
      

  2.   

    就是说不用将类声明为静态类
    只要将方法声明为静态方法
    然后在其他文件中就可以  Class.Method()  是吗?谢谢的说
      

  3.   


    不要错误引导哦,c++是可以定义静态类的,不过静态类里面的方法都必须声明为静态的,不然编译不过。
    LZ的错误应该是 System.cpp或者Exercise.cpp 没有包含 System.h 头文件吧。