PL_initialise call rises an exception on Windows

when app has console window than exception doesn’t trigger. But when app has no console window than rise an exception and app crashes. Please help. I’m trying to build swipl on Windows but it doesn’t work