title: Linking a DLL using xerces gives undefined symbols
body: <p>I'm creating a shared library/DLL using cygwin which makes use of Xerces. When I call the xercesc functions from the main application everything is fine, but when I try to put some code into the library, then I get undefined symbols for all the static stuff that xerxesc defines.</p>
  
  <p>For example:</p>
  
  <pre><code>std::string fromXMLString(XMLCh *oXMLString)
  {
      std::string result;
      xercesc::DOMImplementation *impl =  xercesc::DOMImplementationRegistry::getDOMImplementation(X("Core"));
  
      char *temp = xercesc::XMLString::transcode(oXMLString);
      result = temp;
  
      xercesc::XMLString::release(&amp;temp);
      return result;
  }
  </code></pre>
  
  <p>Linking:</p>
  
  <pre><code>g++ -shared -Wl,-soname,cygsupport.so  -L /usr/local/lib -l xerces-c -o cygsupport.so obj/helper/xml_helper.o 
  </code></pre>
  
  <p>When linking the library, I get:</p>
  
  <pre><code>/usr/local/include/xercesc/internal/XSerializable.hpp:37: undefined reference to `xercesc_3_1::DOMImplementationRegistry::getDOMImplementation(wchar_t const*)'
  /usr/local/include/xercesc/internal/XSerializable.hpp:37: undefined reference to `xercesc_3_1::XMLPlatformUtils::fgMemoryManager'
  /usr/local/include/xercesc/internal/XSerializable.hpp:37: undefined reference to `xercesc_3_1::XMLString::transcode(wchar_t const*, xercesc_3_1::MemoryManager*)'
  /usr/local/include/xercesc/internal/XSerializable.hpp:37: undefined reference to `xercesc_3_1::XMLPlatformUtils::fgMemoryManager'
  /usr/local/include/xercesc/internal/XSerializable.hpp:37: undefined reference to `xercesc_3_1::XMLString::release(char**, xercesc_3_1::MemoryManager*)'
  /usr/local/include/xercesc/internal/XSerializable.hpp:37: undefined reference to `xercesc_3_1::XMLPlatformUtils::fgMemoryManager'
  /usr/local/include/xercesc/internal/XSerializable.hpp:37: undefined reference to `xercesc_3_1::XMLString::release(wchar_t**, xercesc_3_1::MemoryManager*)'
  /usr/local/include/xercesc/internal/XSerializable.hpp:37: undefined reference to `xercesc_3_1::XMLPlatformUtils::fgMemoryManager'
  </code></pre>
  
  <p>...</p>