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

Ville Vainio vvainio at karhu.tp.spt.fi
Thu Jan 24 08:56:07 EST 2002


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*. 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?

> /usr/local/lib, or why it's only a static library (.a) instead of a
> dynamic library (.so), but hey, it works.

It's a portability issue, I've heard.

-- 
Ville Vainio - http://www.tp.spt.fi/~vvainio - ICQ #115524762
 Wild geese have no intention to cast a reflection
 Water has no mind to assume their form



More information about the Python-list mailing list