Eric Roy wrote:
I'm trying to make XOgastan\src xxx.cpp to xxx.o.
I included the XMLString.hpp in the XOgastan\src\include\utils\a2b.h.
But when i make it in BashShell(cygwin) like this:
/cygdrive/c/xogastan/src/utils
$ make

It shows:
g++ -c -DLINUX -D_REENTRANT -fpic -I/usr/include -I/src/include -I/include -o a2b.o b2b.cpp
a2b.cpp:1: warning -fpic ignored for target (all code is position
independent)
a2b.cpp: In static member function 'static std::string
a2b::XMLChar2string(const XMLCh*)':
a2b.cpp:107: error: 'XMLString' has not been declared
a2b.cpp:107: error: 'transcode' undeclared (first use this function)
a2b.cpp:107: error: (Each undeclared identifier is reported only once for
each function it appears in.)
make: *** [a2b.o] Error 1

Here is code where the error apears(a2b.cpp):
string a2b::XMLChar2string(const XMLCh* const toTranscode) {

  string target_string;
  char *char_string;

  // Call the private transcoding method
  char_string = XMLString::transcode(toTranscode);
You probably need to qualify these names with the Xerces-C namespace. There are some handy macros you can use:

char_string = XERCES_CPP_NAMESPACE_QUALIFIER XMLString::transcode(toTranscode);

Or, you can having using declarations:

using XERCES_CPP_NAMESPACE_QUALIFIER XMLString;
char_string = XMLString::transcode(toTranscode);

Dave

Reply via email to