I faced this problem today and just wondering how to check if a new type defined with typedef is really defined somewhere. To give an example, I started using Xerces-c3 library that I built from source code and wrote a xml2text converter. But I couldnt find Xerces-c3 port on fbsd so installed Xerces-c2 library.
When I tried to recompile my source code I got following error:
XML2Text.cc:83: error: cannot declare variable 'handler' to be of abstract type 'XML2TextHandlers'
XML2TextHandlers.h:32: note: because the following virtual functions are pure within 'XML2TextHandlers':
/usr/local/include/xercesc/framework/XMLFormatter.hpp:454: note: virtual void xercesc_2_7::XMLFormatTarget::writeChars(const XMLByte*, unsigned int, xercesc_2_7::XMLFormatter*)
I am using following definition in my header file for writeChars method
virtual void writeChars(const XMLByte* const toWrite,
const XMLSize_t count,
XMLFormatter* const formatter );
I checked that XMLSize_t is nothing but unsigned int declared with following:
#define XERCES_SIZE_T size_t
typedef XERCES_SIZE_T XMLSize_t;
So if I want to make a code compatible to both the libraries how will I do it?
One way I can think of is to check whether the version of the library and define XMLSize_t
accordingly. Any other way?
Thanks,
Shripad