Error when using -staticlib on unsupported platforms