title: -fopenmp flag in compile and link
body: <p>I have this openmp code</p>
  
  <pre><code>#include &lt;omp.h&gt;
  #include &lt;stdio.h&gt;
  
  int main()
  {
    #pragma omp parallel
    {
      fprintf(stderr, "thread %d\n", omp_get_thread_num());
    }
  
    return 0;
  }
  </code></pre>
  
  <p>when I compile and link and use the <code>-fopenmp</code></p>
  
  <pre><code>gcc-6 -std=c99 -Wall -Wextra -pedantic -fopenmp -Iinclude -c -o build/main.o src/main.c
  gcc-6 -o bin/main  build/main.o  -fopenmp
  </code></pre>
  
  <p>the code work </p>
  
  <pre><code>$ ./bin/main 
  thread 0
  thread 1
  thread 2
  thread 3
  </code></pre>
  
  <p>but don't when I only put the flag in the link</p>
  
  <pre><code>gcc-6 -std=c99 -Wall -Wextra -pedantic -Iinclude -c -o build/main.o src/main.c
  src/main.c: In function 'main':
  src/main.c:6:0: warning: ignoring #pragma omp parallel [-Wunknown-pragmas]
     #pragma omp parallel
  gcc-6 -o bin/main  build/main.o  -fopenmp
  </code></pre>
  
  <p>the code work but not in parallel</p>
  
  <pre><code>$ ./bin/main 
  thread 0
  </code></pre>
  
  <p>why I need add <code>-fopenmp</code> in compile and link time?</p>