Linking to Python 2.2

Martin v. Loewis martin at v.loewis.de
Fri Jul 12 15:26:03 EDT 2002


"Nathan Cassano" <nathan at cjhunter.com> writes:

> 	I am having trouble linking to the Python library for
> development purposes. Does anyone know the correct way to link to Python
> version 2.2? 

The correct way depends on the operating system. In this case, you
should study and understand the error messages, and correct them.

> /usr/lib/python2.2/config/libpython2.2.a(posixmodule.o): In function
> `posix_tempnam':
> /usr/src/packages/BUILD/Python-2.2.1/./Modules/posixmodule.c:4451: the
> use of `tempnam' is dangerous, better use `mkstemp'

This is a warning; you can ignore it.

> /usr/src/packages/BUILD/Python-2.2.1/Objects/complexobject.c:148:
> undefined reference to `sin'

This is an error. The symbol "sin" is defined by the math library, so
you need to link with "-lm". Add this linker option, then see what
other errors remain. Proceed for other undefined symbols in the same
way: find out where these symbols are defined, and add the missing
libraries.

In principle, you can use both distutils and the installed
Makefile.pre to obtain the necessary information in a
platform-independent way. However, it would be simpler to just adjust
the build process manually if you target only a few systems.

HTH,
Martin



More information about the Python-list mailing list