Fixed shared compiling and linking