using /fsanitize=address option

The key is the environment. In the visual studio command prompt, the asan library is in the path. If you run that executable outside of that command prompt, it will also not work unless you copy the asan DLL.

Basic Windows madness.