title: OpenMP Mac OSX Lion c++ linker error Undefined symbols for architecture x86_64: "_omp_get_thread_num"
body: <p>I cannot find this question anywhere on the internet.
  So my linker error is: Undefined symbols for architecture x86_64: "_omp_get_thread_num()"</p>
  
  <p>This is my code:</p>
  
  <pre><code>int nthreads;
  int tid;
  #pragma omp parallel private(tid)
  {
      tid = omp_get_thread_num();
      if (tid == 0) 
      {
          nthreads = omp_get_num_threads();
          printf("number of threads: %d\n", nthreads);
      }
  }
  </code></pre>