title: Pthread_create call function in class
body: <pre><code>class Customer{
  public:
         Customer(){};
         Customer(int i)
         {id=i;}
         ~Customer(){...};
         static void* run(void* arg)
         {
         //code for execution
         return NULL;
         }
  private:
  static int id;
  }
  
  int main(void)
  {
      int index;
      int status;
      //Create Customer Threads
      pthread_t Customer_Threads[50];
      Customer *Customers;
      Customers=new Customer[50];
      // create 50 Customer threads
      for (index = 0; index &lt; 50; index++) {
          Customers[index]=*new Customer(index);
          status = pthread_create (&amp;Customer_Threads[index], NULL, Customers[index].run, NULL);
          assert(0 ==status);
      }
  }
  </code></pre>
  
  <p>My question is when i try to use pthread_create to call function in class Customer, the error pop up about 'undefined reference to Customer::~A()''
   and 'undefined reference to `Customer::A()''.</p>
  
  <p>I want to create an array of class Customer object, and use multi_thread to execute the run function in class Customer, i don't know how to deal with these errors. Thanks.</p>
  
  <p>I use C++ in Xcode and compile in linux.</p>
  
  <p>-----------------Update-------------------</p>
  
  <p>Now i still face an error 'undefined reference to `Customer::id''.</p>
  
  <p>Not sure why.</p>