On 9/10/10 7:46 AM, Robert Kern wrote:
On 9/9/10 6:33 PM, Robert Kern wrote:
I have not been able to successfully import PySide.QtCore on OS X 10.6 (32-bit
Python, Qt, and PySide) with any of the revisions of PySide/Shiboken in at least
the past week.
Okay, I see the problem. I am not using the system Python, but the configuration
process seems to be linking to the system Python.
$ otool -L $PYLIB/PySide/QtCore.so
/Library/Frameworks/Python.framework/Versions/Current/lib/python2.6/site-packages/PySide/QtCore.so:
/Users/rkern/git/pyside/build/libpyside/libpyside.0.4.dylib (compatibility
version 0.4.0, current version 0.4.1)
/System/Library/Frameworks/Python.framework/Versions/2.6/Python (compatibility
version 2.6.0, current version 2.6.1)
libshiboken.0.5.dylib (compatibility version 0.5.0, current version 0.5.0)
QtCore.framework/Versions/4/QtCore (compatibility version 4.6.0, current version
4.6.2)
/usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.9.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version
123.0.0)
Is there a way to control this? PYTHON_EXECUTABLE is already pointing to the
desired Python framework in /Library/Frameworks.
Ah, I see the problem. PYTHON_LIBRARY is set to /usr/lib/libpython2.6.lib and
this is used directly in the link line. This is not the correct way to link
Python extension module on OS X. As you will see by compiling any extension
module using distutils, the correct way to link an extension module is to omit
the Python library or framework entirely and use "-undefined dynamic_lookup".
This will cause the extension module to look up unresolved symbols in the
process at load time. Since the interpreter itself is necessarily already up an
running by the time the extension module is loaded, it can provide all of the
Python symbols.
I'm afraid I don't have the cmake-fu to make this change.
--
Robert Kern
"I have come to believe that the whole world is an enigma, a harmless enigma
that is made terrible by our own mad attempt to interpret it as though it had
an underlying truth."
-- Umberto Eco
_______________________________________________
PySide mailing list
[email protected]
http://lists.openbossa.org/listinfo/pyside