Anjana Sharma wrote: > > g++ a1.cpp -I/root/xerces-c_1_1_0-linux/include > /tmp/cc2w3B7T.o: In function `main': > /tmp/cc2w3B7T.o(.text+0xa): undefined reference to > `XMLPlatformUtils::Initialize(void)' > /tmp/cc2w3B7T.o(.text+0x2e): undefined reference to > `SAXParser::SAXParser(XMLValidator *)' > /tmp/cc2w3B7T.o(.text+0x6d): undefined reference to `XMLException > type_info function' > /tmp/cc2w3B7T.o(.text+0x9e): undefined reference to > `XMLException::getMessage(void) const' > collect2: ld returned 1 exit status > > can anyone please help me with this as i am unable to figure > out where i am making the mistake.
You need to link against the library (I don't think your commands above are actually doing this). Try something like this: # compile a1.cpp to a1.o g++ -c -o a1.o a1.cpp -I/root/xerces-c_1_1_0-linux/include # link a1.o with shared library to produce a1 executable g++ -o a1 a1.o -L/root/xerces-c_1_1_0-linux/lib -lxerces-c1_1-linux You might need -lpthread as well. Hope this helps, Mike. -- Mike Mason, Software Engineer XML Script Development Team Office: 44-1865-203192 http://www.xmlscript.org/ Mobile: 44-7050-288923