title: Why am I getting error file format not reognized while compiling?
body: <p>I am using libxml2 parser for parsing xml file. But when I compile using using gcc compiler:</p>
  
  <pre><code>gcc test.c note.xml -I/usr/include/libxml2 -lxml2 -o output
  </code></pre>
  
  <p>It gives me following error:</p>
  
  <pre><code>/usr/bin/ld:note.xml: file format not recognized; treating as linker script
  /usr/bin/ld:note.xml:1: syntax error
  collect2: error: ld returned 1 exit status
  </code></pre>
  
  <p>Here is my test.c file:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;libxml/parser.h&gt;
  #include &lt;libxml/tree.h&gt;
  
  void readfile(const char* filename) {
      xmlDocPtr doc;
      doc = xmlReadFile(filename,NULL,0);
      if(doc == NULL)
         return;
      xmlFreeDoc(doc);
  }
  
  int main(int argc,char* argv[]) {
      if(argc != 2)
          return 1;
      LIBXML_TEST_VERSION
      readfile(argv[1]);
      xmlCleanupParser();
      xmlMemoryDump();
      return 0; 
  } 
  </code></pre>
  
  <p>Here is my xml file:</p>
  
  <pre><code>&lt;note&gt;
    &lt;to&gt;Tove&lt;/to&gt;
      &lt;from&gt;Jani&lt;/from&gt;
        &lt;heading&gt;Reminder&lt;/heading&gt;
          &lt;body&gt;Don't forget me this weekend!&lt;/body&gt;
     &lt;/note&gt;
  </code></pre>