faqts : Computers : Programming : Languages : Python : Extension Programming

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

8 of 10 people (80%) answered Yes
Recently 8 of 10 people (80%) answered Yes

Entry

How do I know with which libraries I have to link my extension module?

Oct 1st, 2001 02:51
Gerhard Haering,


Using distutils helps a lot here. You can write a setup.py file for 
your extension module and let distutils figure out most of the things 
how to build the extension module. You'll then only have to provide 
the *addional* libraries to link against. Not the ones the Python 
library needs. The Python docs contain an introduction to distutils.
Now, if you want to build the extension module yourself, say with a 
Makefile. You'll have to figure out what libraries you'll need to link 
against because of Python. This will print out the needed libraries:
from distutils.sysconfig import get_config_var
print get_config_var("LIBS") + " " + get_config_var("SYSLIBS")