You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by Alberto Massari <am...@progress.com> on 2004/11/14 14:34:30 UTC
Re: Unable to compile a simple sample ('XercesDOMParser'
undeclared)
Hi Thomas,
XercesDOMParser is in the Xerces namespace, so you need to fully qualify
(e.g. XERCES_CPP_NAMESPACE_QUALIFIER XercesDOMParser) or add a "using
XERCES_CPP_NAMESPACE;" instruction.
Alberto
At 14.31 14/11/2004 +0100, thomas Armstrong wrote:
>Hi.
>
>I installed xerces-c-2.5.0 on my Linux RedHat box.
>
>Inside '/usr/local/lib' are:
>- libxerces-c.so
>- libxerces-c.so.25.0
>- libxerces-c.so.25
>
>Inside '/usr/local/include/xercesc/' are:
>- dom
>- framework
>- internal
>- parsers
>- sax
>- sax2
>- util
>- validators
>
>I want to create a 'Hello World' program ('hello.cpp':
>---------------------//---------------------------------
>#include <xercesc/util/PlatformUtils.hpp>
>#include <xercesc/dom/DOM.hpp>
>#include <xercesc/dom/DOMImplementation.hpp>
>#include <xercesc/dom/DOMImplementationLS.hpp>
>#include <xercesc/dom/DOMWriter.hpp>
>#include <xercesc/framework/StdOutFormatTarget.hpp>
>#include <xercesc/framework/LocalFileFormatTarget.hpp>
>#include <xercesc/parsers/XercesDOMParser.hpp>
>#include <xercesc/util/XMLUni.hpp>
>#include <stdio.h>
>
>int main()
>{
> XercesDOMParser *parser = new XercesDOMParser;
> printf ("Hello world!\n");
> return 0;
>}
>-----------------------//-------------------------------
>
>Within my 'Makefile' file:
>-----------------//-----------------------------
>CFLAGS = -I/usr/include/ -I/usr/local/include
>LIBS = -L/usr/local/lib
>-----------------//-----------------------------
>
>But I get this error message:
>-----------------//--------------------
>`XercesDOMParser' undeclared (first use this function)
>`parser' undeclared (first use this function)
>----------------//---------------------
>
>What am I doing wrong? Thank you very much.
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
>For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org