Updated building script. Fix compiling errors under x64.