Since we have later 
viewer<< Viewer3D<>::updateDisplay;
we should use here:
Viewer3D<> viewer(K);

Another solution is to define the type as:
typedef Viewer3D<...> MyViewer3D;
and use it afterwards