[New-bugs-announce] [issue7541] python-config --ldflags doesn't pick up libpython2.5.a

Robin report at bugs.python.org
Fri Dec 18 17:28:08 CET 2009


New submission from Robin <robince at gmail.com>:

Using my python.org install:
robin-mbp:~ robince$ which python-config
/Library/Frameworks/Python.framework/Versions/2.5/bin/python-config
robin-mbp:~ robince$ python-config --ldflags
-L/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/config
-ldl -lpython2.5

But if I build a C file with python embedded, the above linker flags
result it in it embedding the system python. Obviously the -lpython2.5
is picking up the system one in preference to the one on the -L path.

>From Ronald Oussoren on pythonmac-sig:

The easiest workaround is to open a terminal window and execute the 
following commands:

  cd 
/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/config
  ln -s libpython2.5.a libpython2.5.dylib

This will ensure that the OSX linker knows that libpython is a shared 
library and links to this library. By default the OSX linker searches 
for a .dylib on the entire linker path and only then looks for .a files.

----------
assignee: ronaldoussoren
components: Macintosh
messages: 96569
nosy: robince, ronaldoussoren
severity: normal
status: open
title: python-config --ldflags doesn't pick up libpython2.5.a
versions: Python 2.5, Python 2.6, Python 2.7

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue7541>
_______________________________________


More information about the New-bugs-announce mailing list