Hi there!
Since you are using GL3, you should also do:
shader.bindDefaults();
Before linkProgram(). Alternately, you can also do:
shader.load("vertex.vert", "frag_#.frag");
So that you can still share the same vertex shader.
You could also check the vboMeshDrawInstancedExample example, where it uses a shared_ptr. It's a simple, but nice way to use/play with shaders.