prog.cpp:10:40: warning: friend declaration 'void printVar(const MyVar<T>&)' declares a non-template function [-Wnon-template-friend]
friend void printVar(const MyVar & var);
^
prog.cpp:10:40: note: (if this is not what you intended, make sure the function template has already been declared and add <> after the function name here)
prog.cpp:11:33: warning: friend declaration 'void scanVar(MyVar<T>&)' declares a non-template function [-Wnon-template-friend]
friend void scanVar(MyVar & var);
^
/home/POhCBl/ccjI3ner.o: In function `main':
prog.cpp:(.text.startup+0x17): undefined reference to `scanVar(MyVar<Foo>&)'
prog.cpp:(.text.startup+0x1f): undefined reference to `printVar(MyVar<Foo> const&)'
collect2: error: ld returned 1 exit status