Hello,
Xerces C++ is installed on my system (linux RedHat 7.2). If I run the
binary samples (i.e. DOMPrint, PParse ...), this is working perfectly.
They are located in /usr/local/xerces/bin
My question is how do I manage my own Makefile in order to compile my
own sample? Given that a HelloWorld file is in /home/mael/xml/ :
===============================
#include <iostream.h>
#include <stdlib.h>
#include <xercesc/parsers/SAXParser.hpp>
int main(int argC, char* argV[])
{
cout<<" HelloWorld ... testing SAXParser class"<<endl;
SAXParser* parser = new SAXParser;
delete parser;
return 0;
}
===============================
Here is the result of the compilation:
> make HelloWorld
g++ HelloWorld.cpp -o HelloWorld
/tmp/ccQ982dH.o: In function `main':
/tmp/ccQ982dH.o(.text+0x80): undefined reference to
`SAXParser::SAXParser(XMLValidator *)'
collect2: ld returned 1 exit status
make: *** [HelloWorld] Error 1
I guess it is a problem of library link. How do I manage this in the
Makefile ?
Especially the setting of the env. var. XERCESCROOT and the link
-lxerces-c . I have to be root and do a ldconfig ?
This command:
$ g++ -I/usr/local/xerces/include HelloWorld.cpp -o HelloWorld
-L/usr/local/xerces/lib -lxerces-c
gives:
/usr/bin/ld: cannot find -lxerces-c
collect2: ld returned 1 exit status
Thanks for helping beginners,
Ma�l
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]