Embedding, linking (was Re: Python from C, PyRun_String()

Kragen Sitaker kragen at pobox.com
Tue Jan 29 23:48:14 CET 2002

Ville Vainio <vvainio at karhu.tp.spt.fi> writes:
> Kragen Sitaker <kragen at pobox.com> writes:
> > It varies.  You probably want to link at least with libpython2.1
> > (-L/usr/local/lib/python2.1/config -lpython2.1 on my system), but I
> > also have to link with -lxmlparse -ldl -lpthread -lxmltok -lutil,
> > because my Python was configured with dynamic loading, pthreads, and
> > XML support from expat.
> BTW, why does one have to link with xml*? I thought that importing a
> dll that provides C stuff for XML parsing (w/ python 'import') would
> be enough... After all, the python executable itself isn't linked with
> xml*.

Mine is; that's why.  If yours isn't, you don't.

> And installing PyXML *after* the python has been compiled and
> installed seems to be enough (though I haven't tried using it in an
> embedded interpreter yet - will do it next week, I need
> xml.dom.minidom). I'm rather confused with the process. Is this
> something that is misunderstood, under the process of being fixed,
> or just too rare (being embedding, after all) to be documented in
> detail?

I think my Python just got built dynamically linked with XML built in
instead of having XML loadable from a .so, that's all.

More information about the Python-list mailing list