fixed windows link error and compile warnings