move viewer demo code to samples
silence compiler warning
build shared object library