Linking to Python 2.2

Nathan Cassano nathan at cjhunter.com
Fri Jul 12 15:55:25 EDT 2002


Thanks for your help Martin,

> The correct way depends on the operating system. In this case, you
> should study and understand the error messages, and correct them.
>
> > /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.

I guess I had a mental black there for a moment. Yes, -lm fixed the
problem.
I found some other applications that use embedded Python, was able to
reuse
parts of their autoconf scripts and now it's all compiling fine. Thanks
again!

Nathan






More information about the Python-list mailing list