[Expat-discuss] how to compile

Greg Martin Greg.Martin at TELUS.COM
Wed Feb 23 16:39:10 CET 2005


It's not actually hanging - it's waiting for input. 
If you read the comment at the top of the file you'll
find the program reads from stdin and writes to stdout.
In other words it acts like a filter. You'll need to pipe 
input to it : cat yourfile.xml | ./a.out
or after running  : ./a.out
Type:
<test>
	<one>
		stuff
	</one>
</test>


> -----Original Message-----
> From: expat-discuss-bounces at libexpat.org 
> [mailto:expat-discuss-bounces at libexpat.org] On Behalf Of 
> Muhammad Rizwan Khan
> Sent: Wednesday, February 23, 2005 2:46 AM
> To: expat-discuss at libexpat.org
> Subject: RE: [Expat-discuss] how to compile
> 
> 
> Thanks for your help. Program is running but the problem is i 
> can't run it. Whenever i execute ./a.out, it hangs and dont 
> give any output.
> Can you please tell me, what is missing here?
> 
> Thanks
> 
> On Tue, 2005-02-22 at 22:32, Greg Martin wrote:
> > You need to tell gcc to use libexpat when it links (e.g. -lexpat).
> > Usually a good idea to add the link instruction at the end.
> > gcc elements.c -lexpat
> > 
> > > -----Original Message-----
> > > From: expat-discuss-bounces at libexpat.org
> > > [mailto:expat-discuss-bounces at libexpat.org] On Behalf Of Muhammad 
> > > Rizwan Khan
> > > Sent: Tuesday, February 22, 2005 7:29 AM
> > > To: expat-discuss at libexpat.org
> > > Subject: [Expat-discuss] how to compile
> > > 
> > > Hello
> > > 
> > > I have just installed expat on my system. When i tried to compile 
> > > the program given in the example directory provided with the 
> > > distribution, im getting the following error message:
> > > 
> > > [root at Rizwan examples]# gcc elements.c
> > > /tmp/cceoXODZ.o(.text+0x80): In function `main':
> > > : undefined reference to `XML_ParserCreate'
> > > /tmp/cceoXODZ.o(.text+0xa8): In function `main':
> > > : undefined reference to `XML_SetUserData'
> > > /tmp/cceoXODZ.o(.text+0xc3): In function `main':
> > > : undefined reference to `XML_SetElementHandler'
> > > /tmp/cceoXODZ.o(.text+0x11c): In function `main':
> > > : undefined reference to `XML_Parse'
> > > /tmp/cceoXODZ.o(.text+0x131): In function `main':
> > > : undefined reference to `XML_GetCurrentLineNumber'
> > > /tmp/cceoXODZ.o(.text+0x143): In function `main':
> > > : undefined reference to `XML_GetErrorCode'
> > > /tmp/cceoXODZ.o(.text+0x14c): In function `main':
> > > : undefined reference to `XML_ErrorString'
> > > /tmp/cceoXODZ.o(.text+0x18a): In function `main':
> > > : undefined reference to `XML_ParserFree'
> > > collect2: ld returned 1 exit status
> > > 
> > > Can you please guide me, what i need to do in order to 
> compile this 
> > > program.
> > > 
> > > Thanks
> > > 
> > > 
> > > _______________________________________________
> > > Expat-discuss mailing list
> > > Expat-discuss at libexpat.org
> > > http://mail.libexpat.org/mailman/listinfo/expat-discuss
> > > 
> 
> _______________________________________________
> Expat-discuss mailing list
> Expat-discuss at libexpat.org
> http://mail.libexpat.org/mailman/listinfo/expat-discuss
> 


More information about the Expat-discuss mailing list