静态const类成员的奇怪链接器问题

| 请告诉我,为什么gcc链接程序给我以下错误:\“ test_class :: test_struct :: constVar \”,引用自test_class.o中的__ZN12lu_test_class27test_struct6constVar $ non_lazy_ptr? 我的代码(test_class.h):
class test_class
{
    struct test_struct
    {
         static const int constVar = 0;
    };
};
所有对constVar的引用都以通常的静态成员访问形式在test_class范围内:test_struct :: constVar。     
已邀请:
在类外提供静态成员的定义
const int test_class::test_struct::constVar;
这对我有用。     

要回复问题请先登录注册