modified for cross-compilation with mingw64 on ubuntu 14.04