Add cast for mingw compiler
Undef SearchPath where needed as it is defined via windows.h

This is pretty annoying, might even be worth renaming the class