静态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。
没有找到相关结果
已邀请:
1 个回复
枫湃揩乾纲
这对我有用。