title: Cannot use fsanitize=address in minGW compiler
body: <p><strong>My C++ Setup INFO :</strong>
  OS - <em>Windows 10</em>,
  IDE - <em>VS Code</em>,
  compiler - <em>MinGw</em></p>
  <p><strong>ISSUE :</strong>
  I recently found sanitizers for C++ to catch some runtime errors like out of bound array access with <code>-fsanitize=address</code> and <code>-fsanitize=undefined</code> in my VS Code environment.</p>
  <p>This is a simple program for out of bound array access :
  <a href="https://i.stack.imgur.com/3vlWV.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3vlWV.png" alt="enter image description here" /></a></p>
  <p>in VS Code terminal being used is <strong>CMD</strong> when i tried to compile the program with this line <code>g++ -fsanitize=address check.cpp -o main.exe</code>
  <a href="https://i.stack.imgur.com/zdSWS.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zdSWS.png" alt="enter image description here" /></a></p>
  <p>On hitting enter I got this error ( cannot find -lasan ) :
  <a href="https://i.stack.imgur.com/jzg3p.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jzg3p.png" alt="enter image description here" /></a></p>
  <p><strong>here is the c++ code</strong> -&gt;</p>
  <pre><code>// Program to demonstrate 
  // accessing array out of bounds
  #include &lt;iostream&gt;
  using namespace std ;
  int main()
  {
      int arr[] = {1,2,3,4,5};
      cout&lt;&lt;arr[0]&lt;&lt;endl;
        
      // arr[10] is out of bound
      cout&lt;&lt;arr[10]&lt;&lt;endl;
      return 0;
  }
  </code></pre>
  <p><strong>Cause(s)/Solution(s) for this issue</strong></p>
  <ol>
  <li><p>How to fix cannot find -lasan ?</p>
  </li>
  <li><p>Does MinGW not support these sanitizers, if so, shall I use cygwin ?</p>
  </li>
  <li><p>Can I install clang on windows machine (if possible) to use this
  whole bunch of sanitizers ?</p>
  </li>
  <li><p>What are the other options to use besides using Visual Studio
  instead of VS Code ??</p>
  </li>
  <li><p>Any other suggestions</p>
  </li>
  </ol>
  <p><strong>NOTE : kindly suggest me suitable tags for this post (if I have used a wrong one or missed a crucial one)</strong></p>