title: Thread error while compiling the Xml parser in C?
body: <pre><code>[root@localhost mxml-2.7]# gcc -o xml XmlParser1.c -lmxml
  XmlParser1.c: In function ‘main’:
  XmlParser1.c:63: warning: assignment discards qualifiers from pointer target type
  /usr/local/lib/libmxml.so: undefined reference to `pthread_key_create'
  /usr/local/lib/libmxml.so: undefined reference to `pthread_once'
  /usr/local/lib/libmxml.so: undefined reference to `pthread_getspecific'
  /usr/local/lib/libmxml.so: undefined reference to `pthread_key_delete'
  /usr/local/lib/libmxml.so: undefined reference to `pthread_setspecific'
  collect2: ld returned 1 exit status
  </code></pre>
  
  <p>Following error occurred while compiling the XmlParser1.c.
  XmlParser1.c:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include "mxml.h"
  #include &lt;sys/types.h&gt;
  #include &lt;sys/stat.h&gt;
  #include &lt;fcntl.h&gt;
  #include &lt;string.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;unistd.h&gt;
  #include &lt;string.h&gt;
  
  #define MAX_SIZE 25
  
  static mxml_node_t *xml; 
  static mxml_node_t *str;
  static mxml_node_t *DataSet;
  
  static mxml_node_t *Table;
  static mxml_node_t *IsAuthenticated;
  static mxml_node_t *AuthenticationDate;
  static mxml_node_t *Response;
  
  int main()
  {
      int fd = 0;
      char *Result=NULL;
      const char *NewResult=NULL;
      mxml_node_t *tree;
      mxml_node_t *data;
      const char *type = NULL;
  
      FILE *fp = fopen("/home/suneet/mxml-2.7/Sample/main.xml", "r")  ;
      if (fp == NULL)
      {
          fclose(fp);
      }
      else
      {
          fseek (fp , 0, SEEK_END);
          long settings_size = ftell (fp);
          rewind (fp);
  
          if (settings_size &gt; 0)
          {
              tree = mxmlLoadFile(NULL, fp, MXML_NO_CALLBACK);
              fclose(fp);
  
              printf("step 1\n");
              data = mxmlFindElement(Table, tree, "diffgr:id", NULL, NULL, MXML_DESCEND);
              Result = mxmlElementGetAttr(data,"diffgr:id");
              printf("diffgr:id:%s\n",(Result == NULL)?"NULL":Result);
              mxmlDelete(data);
              mxmlDelete(tree);   
          }
      }
  
      return 0;
  }
  </code></pre>
  
  <p>while i am trying to go with the steps given in <a href="http://minixml.org/" rel="nofollow">http://minixml.org/</a>; parse accordingly the xml file there is certain error "undefined error to threads for dynamic library libxml.so.". </p>
  
  <p>Please guide me so that i can successfully parse the xml file.</p>