Can't load .pyd files from embedded Python interp

Gordon McMillan gmcm at hypernet.com
Mon Jul 17 14:01:36 EDT 2000


Edward K. Ream wrote:

>Gordon McMillan wrote:
>
>> Most people just use python15.dll from their embedding app so both get
>> the same copy. 

[snip]

>Gordon, thanks so much for this reply.  This was precisely what I
>needed.
>

[snip]

>This illustrates one of the most common failings in documentation:
>failing to tell _what_ the reader is to do and _why_.  Much
>documentation just jumps in and explains _how_ to do something.  I just
>reviewed the Python Extending and Embedding docs.  There is no mention
>that one must link against python15.dll, and certainly no hint about
>why that is necessary.  One or two sentences in the docs might have
>saved me about a week of enjoyable, but useless, work.

Well, this is a requirement that's unique to Windows. Unixen (those that 
allow dynamic linking) do (essentially) a full link at runtime, so there's 
no problem getting symbols from the executable. There's also no concept of 
an "import lib". And Windows doesn't spell "import lib" differently than 
"static lib", so it's easy to mistake "python15.lib" for a reference to a 
static lib, when in fact it means the import lib for python15.dll.

It's difficult to know where to document all the platform specific aspects 
of embedding / extending (especially when it's kind of a moving target). I 
would guess that most people started by building Python from source, and 
then playing with the examples.

>I'll write up my experiences when I've successfully embedded Python in
>my app.  For now the conclusion seems to be that one only need link in
>C:\Windows\System\python15.dll to the app.  There are some details
>specific to Borland, but presumably they won't be difficult.

I hope you're right about that.

- Gordon



More information about the Python-list mailing list