[PyQt] Python modules shouldn't link directly to Python framework on OS X

Brian Kelley kelley at eyesopen.com
Fri Nov 21 19:06:50 GMT 2008


While I agree with the sentiment "-undefined dynamic_lookup" has caused me issues in the past, mainly with startup time for larger libraries.

I was under the impression that -framework Blah would work between point releases.  We have been linking this way for quite some time.

We generally built python extensions that are not intended to be shipped individually but rather are built with our own interpreter which is essentially statically linked to the system python (due to vendorid issues).  This, then, can import the PyQt dlls.  Since we are built with a particular version of python I think it is prudent to not use the "-undefined dynamic_lookup" flag when using PyQt.

Perhaps we could use dynamic lookup across our build system, but I admit that it does make me nervous.  In any case I'll test any new PyQt that comes down the pike and let everyone know what happens.

Brian Kelley



On 11/21/08 1:31 PM, "William Kyngesburye" <woklist at kyngchaos.com> wrote:

On Nov 21, 2008, at 11:56 AM, Brian Kelley wrote:

> In my humble opinion there should be an option for linking against
> the framework libraries.  I don't mind having the default be as
> described.
>
> As the framework library is the only thing I test against, I would
> prefer having the option to only use this library.  I have been
> burned too many times by customers having an incorrect library in
> their path so I have come to respect the "link to this library or
> don't run approach".
>
Except that it's not the right way to link python (or any program's)
extensions.

A better approach (I think), if you're worried, is to check that the
version of python that you need is running before importing stuff.
This way you can gracefully quit with a helpful message to the user.
If you rely on the system linker not finding the library, the user
gets a crash with a cryptic (to many) message about something not
being found.  Or sometimes not even that (some people may turn off
crash report messages).

-----
William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
http://www.kyngchaos.com/

"Those people who most want to rule people are, ipso-facto, those
least suited to do it."

- A rule of the universe, from the HitchHiker's Guide to the Galaxy



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20081121/fe9c7ebe/attachment.html


More information about the PyQt mailing list