title: How to install and use Openmp in vs code
body: <p>I have install and run correctly c/c++ in vscode, my gcc version is 8.2.0 and I have installed MinGw</p>
  
  <p>I use VS code to run my C program</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;omp.h&gt;
  
  int main(int argc, char* argv[])
  {
      int nthreads, tid;
      {
          tid = omp_get_thread_num();
          printf("welcome to GFG from thread = %d\n", tid);
          if (tid == 0){
              nthreads = omp_get_num_threads();
              printf("number of threads = %d\n", nthreads);
          }
      }
  }
  </code></pre>
  
  <p>but it didn't work because </p>
  
  <pre><code>[Running] cd "c:\cexam\" &amp;&amp; gcc openmp_helloword.c -o openmp_helloword &amp;&amp; "c:\cexam\"openmp_helloword
  c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\Users\WinstonLi\AppData\Local\Temp\ccAAWXl3.o:openmp_helloword.c:(.text+0xf): undefined reference to `omp_get_thread_num'
  c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\Users\WinstonLi\AppData\Local\Temp\ccAAWXl3.o:openmp_helloword.c:(.text+0x33): undefined reference to `omp_get_num_threads'
  collect2.exe: error: ld returned 1 exit status
  </code></pre>