[Expat-discuss] static libexpat library

Fred L. Drake, Jr. fdrake at acm.org
Tue Oct 21 03:22:45 EDT 2003


Alan Leigh writes:
 > My program uses expat, which works well. The problem is I am now trying to
 > build my project linking expat staticly. If I build with the correct
 > paths (-L and -I) and use -lexpat everything builds and links ok. If I do
 > this instead -l/usr/lib/libexpat.a , I get a whole heap of undefined
 > reference errors (XML_ParserCreate... XML_SetElementHandler etc etc). Any
 > ideas? Or is what I am doing wrong?

To specify a static library using a complete pathname, don't use the
-l option, just name the library.  "-l" should only be used with the
"short" name of the library ("expat" in this case).  What's happening
in your example is that the library

   lib/usr/lib/libexpat.a.a

isn't being found.  The error message certainly isn't very helpful,
but matches my experience.


  -Fred

-- 
Fred L. Drake, Jr.  <fdrake at acm.org>
PythonLabs at Zope Corporation



More information about the Expat-discuss mailing list