prog.cpp: In static member function ‘static void c1::c2::func()’:
prog.cpp:23:9: warning: unused variable ‘f1’ [-Wunused-variable]
int f1= c1::a1; //works
^
prog.cpp:24:9: warning: unused variable ‘f2’ [-Wunused-variable]
int f2= c1::a2;
^
/home/d91WcC/cc5NqOCF.o: In function `c1::c2::func()':
prog.cpp:(.text+0xc): undefined reference to `c1::a1'
prog.cpp:(.text+0x16): undefined reference to `c1::a2'
collect2: error: ld returned 1 exit status