[Expat-discuss] how to compile

Greg Martin Greg.Martin at TELUS.COM
Tue Feb 22 18:32:01 CET 2005


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
> 


More information about the Expat-discuss mailing list