title: How to define a object or struct as threadprivate in OpenMP?
body: <p>I don't know how to make a struct or object as threadprivate, what I'm doing generates a error:</p>
  
  <pre><code>    struct point2d{
          int x;
          int y;
          point2d(){
              x = 0;
              y = 0;
          }
          //copy constructor
          point2d(point2d&amp; p){
              x = p.x;
              y = p.y;
          }
      };      
  </code></pre>
  
  <p>I declare a static structure and try to make them threadprivate</p>
  
  <pre><code>    static  point2d myPoint;
      #pragma omp threadprivate(myPoint)
  </code></pre>
  
  <p>It generates an error:</p>
  
  <blockquote>
    <p>error C3057: 'myPoint' : dynamic initialization of 'threadprivate' symbols is not currently supported</p>
  </blockquote>
  
  <p>Does it means that current openmp compiler doesn't support this to make a struct threadprivate? Or what I'm doing is wrong.
  Is there any alternate way to pass a struct or object?</p>
  
  <p>Here's rest part of my codes:</p>
  
  <pre><code>    void myfunc(){
          printf("myPoint at %p\n",&amp;myPoint);
      }
  
      void main(){
      #pragma omp parallel
         {
             printf("myPoint at %p\n",&amp;myPoint);
             myfunc();
         }
  
      }
  </code></pre>