title: Code::Blocks, ld.exe error "Cannot find -lgomp"
body: <p>I'm trying to learn how to use openMP but I keep getting errors while using Code::Blocks.</p>
  <p>I installed the MinGW version as recommended, and set up the Compiler as following.</p>
  <p>Settings -&gt; Compiler -&gt; Compiler Settings -&gt; Other options , added -fopenmp.</p>
  <p>Then in Linker settings -&gt; Other linker options added -lgomp.</p>
  <p>When trying to build the program, I get the message</p>
  <blockquote>
  <p>ld.exe||cannot find -lgomp|</p>
  <p>ld.exe||cannot find -lgomp|
  ||=== Build failed: 2 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|</p>
  </blockquote>
  <p>I'm using the GNU GCC Compiler, the program I'm trying to run is the following.</p>
  <pre><code>#include &lt;omp.h&gt;
  #include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  
  int main (int argc, char *argv[]) 
  {
  int nthreads, tid;
  
  #pragma omp parallel private(nthreads, tid)
    {
  
    tid = omp_get_thread_num();
    printf(&quot;Hello World from thread = %d\n&quot;, tid);
  
    if (tid == 0) 
      {
      nthreads = omp_get_num_threads();
      printf(&quot;Number of threads = %d\n&quot;, nthreads);
      }
  
    }
  
  }
  </code></pre>
  <p>I tried many solutions posted online but nothing seems to work. What am I doing wrong?
  Thank you in advance.</p>