aa.cpp : static Ctest *gp_test = 0;
bb.cpp 中声明:extern static Ctest *gp_test ;
错误 1 error C2159: 指定了一个以上的存储类 extern Ctest *gp_test ;
错误 1 error LNK2001: 无法解析的外部符号
错误 2 fatal error LNK1120: 1 个无法解析的外部命令
在bb.cpp 文件中该怎么引用?谢谢.
bb.cpp 中声明:extern static Ctest *gp_test ;
错误 1 error C2159: 指定了一个以上的存储类 extern Ctest *gp_test ;
错误 1 error LNK2001: 无法解析的外部符号
错误 2 fatal error LNK1120: 1 个无法解析的外部命令
在bb.cpp 文件中该怎么引用?谢谢.
似乎有一个是只在局部有效 所以没办法被引用。
Global variable:文件作用域:可以加上extern 声明为外部变量,跨文件作用域