COMP: Fix build when using shared libraries and add VTK 6 compatibility