You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-users@xerces.apache.org by corrado c <cc...@hotmail.com> on 2005/08/27 15:02:10 UTC

xercers g++ compiling

Hello,
my name is Corrado and I trying to use xerces xml parser in my c++ projects.

I followed build instruction and I have build samples
so, now I find a bin directory with binary files that works correctly!!

My trouble is : I don't be able to compile a simple
c++ program because I receiving the following error:

In file included from MySaxHandler.cc:1:
MySAXHandler.h:1:47: xercesc/include/sax/HandlerBase.hpp: No such file or 
directory

MySAXHandler.h
--------------------
#include <xercesc/include/sax/HandlerBase.hpp>

class MySAXHandler : public HandlerBase {
public:
void startElement(const XMLCh* const, AttributeList&);
void fatalError(const SAXParseException&);
};


in MySaxHandler.cc I have included: (both file is in the same directory)
#include "MySAXHandler.h"


NB:
I set $XERCESCROOT=/opt/xerces-c-src_2_6_0
and I try to use g++ -I flag to specify the /opt/xerces-c-src_2_6_0/include 
directory

I set $LD_LIBRARY_PATH=/opt/xerces-c-src_2_6_0/lib

But, I always receive the same error!
Please let me know.


Corrado

_________________________________________________________________
Personalizza MSN Messenger con sfondi e fotografie! 
http://www.ilovemessenger.msn.it/


Re: xercers g++ compiling

Posted by James Sturtevant <Ja...@aol.com>.
Hey Corrado,

I found that I needed to specifiy directly where the library was 
installed with g++. 
I install the the Xerces C++ library in /usr/local/lib/.

So on my compile statement i did:

g++ -o myProg myProg.cpp /usr/local/lib/<name of Xerces library>  (i 
think its something like ldlibxercesc++.lo)

So you should specify the location of the library at

/opt/xerces-c-src_2_6_0/lib/<library name> in your g++ statement.

Hope that helps.

James


ccorrado14@hotmail.com wrote:

> Hello,
> my name is Corrado and I trying to use xerces xml parser in my c++ 
> projects.
>
> I followed build instruction and I have build samples
> so, now I find a bin directory with binary files that works correctly!!
>
> My trouble is : I don't be able to compile a simple
> c++ program because I receiving the following error:
>
> In file included from MySaxHandler.cc:1:
> MySAXHandler.h:1:47: xercesc/include/sax/HandlerBase.hpp: No such file 
> or directory
>
> MySAXHandler.h
> --------------------
> #include <xercesc/include/sax/HandlerBase.hpp>
>
> class MySAXHandler : public HandlerBase {
> public:
> void startElement(const XMLCh* const, AttributeList&);
> void fatalError(const SAXParseException&);
> };
>
>
> in MySaxHandler.cc I have included: (both file is in the same directory)
> #include "MySAXHandler.h"
>
>
> NB:
> I set $XERCESCROOT=/opt/xerces-c-src_2_6_0
> and I try to use g++ -I flag to specify the 
> /opt/xerces-c-src_2_6_0/include directory
>
> I set $LD_LIBRARY_PATH=/opt/xerces-c-src_2_6_0/lib
>
> But, I always receive the same error!
> Please let me know.
>
>
> Corrado
>
> _________________________________________________________________
> Personalizza MSN Messenger con sfondi e fotografie! 
> http://www.ilovemessenger.msn.it/
>


Re: xercers g++ compiling

Posted by Axel Weiß <aw...@informatik.hu-berlin.de>.
corrado c schrieb:
> Hello,
> my name is Corrado and I trying to use xerces xml parser in my c++
> projects.
>
> I followed build instruction and I have build samples
> so, now I find a bin directory with binary files that works
> correctly!!
>
> My trouble is : I don't be able to compile a simple
> c++ program because I receiving the following error:
>
> In file included from MySaxHandler.cc:1:
> MySAXHandler.h:1:47: xercesc/include/sax/HandlerBase.hpp: No such file
> or directory

Hi Corrado,

this is an error message from your c++ compiler, stating that it cannot 
find 'xercesc/include/sax/HandlerBase.hpp'. As you tell below, you add 
to the include path '/opt/xerces-c-src_2_6_0/include'. In best case, the 
compiler tries to find 
'/opt/xerces-c-src_2_6_0/include/xercesc/include/sax/HandlerBase.hpp', 
which doubtly exists.

I'd try to include 'sax/HandlerBase.hpp' in your header and leave 
everything as it is.

Cheers,
			Axel

-- 
Humboldt-Universität zu Berlin
Institut für Informatik
Signalverarbeitung und Mustererkennung
Dipl.-Inf. Axel Weiß
Rudower Chaussee 25
12489 Berlin-Adlershof
+49-30-2093-3050
** www.freesp.de **