add VC2012 project to compile static and dynamic lib, also fix some C

issues