XMLPARSER_EXPORT is defined by Xerces in util\XercesDef.hpp; you will have to choose a different macro for your project.

Alberto

Stephen Collyer wrote:
I have a problem compiling when I include DefaultHandler.hpp.
I'm rather baffled as to the nature of the problem, but it
seems to be related to a #define that I'm using to specify
the export class for Win32.

The following code compiles fine:

#ifndef MDP_XMLPARSER
#define MDP_XMLPARSER

#include <xercesc/sax2/DefaultHandler.hpp>
#include "Support.h"
#include "ManifestElement.h"

#include "exports/XMLParser_export.h"

class XMLParseResult {
};

with XMLParser_export.h as follows:

#ifndef XMLPARSER_EXPORT
#define XMLPARSER_EXPORT

// <library name>_EXPORTS is defined by cmake when
// the library must be built with symbols exported

#if defined (WIN32) && defined (BUILD_SHARED_LIBS)
#pragma warning(disable: 4251)
  #if defined(XMLParser_EXPORTS)
    #define XMLPARSER_EXP __declspec(dllexport)
  #else
    #define XMLPARSER_EXP __declspec(dllimport)
  #endif
#else #define XMLPARSER_EXP
#endif

#endif // XMLPARSER_EXPORT

However, if I change the class declaration to:

class XMLPARSER_EXP XMLParseResult
{
};

then g++ gives me the following message:

src/lib/XMLParser.h:11: error: function definition does not declare parameters

and a similar one from VSC++.

Both versions compile OK when I don't include DefaultHandler.hpp
Can anyone see what I'm screwing up, if anything ?



Reply via email to