Please tell me why the gcc linker gives me the following error: "test_class :: test_struct :: constVar" referenced: __ZN12lu_test_class27test_struct6constVar $ non_lazy_ptr in test_class.o
My code ( test_class.h ):
class test_class { struct test_struct { static const int constVar = 0; }; };
All references to constVar are in the test_class area in the usual form for accessing the static member: test_struct :: constVar .
Ryan source share