BUG: Fixing issues with static build on windows