how does python use its .lib files?

Syver Enstad syver-en+usenet at online.no
Fri Aug 29 18:41:45 EDT 2003


"George Khoury" <khoury at physics.ucsb.edu> writes:

> I am just starting to code some c extensions, and have been
> experimenting with both the Borland and MSVC compilers. Everything
> works, but I have a basic question. When using Borland, I have to
> make an OMF version of Python23.lib. Does this mean I now have two
> copies of the python interpreter?

No, Python23.lib is not a traditional .lib file, it is a so called
import library, which just makes your C linker happy, and actually
links in the code via the Python23.dll at runtime.

> Or maybe I should ask another question. Suppose I have imported two
> extension modules compiled with MS and Borland. If they both call a
> python function (say, PyArg_ParseTuple), they are linking to two
> different libraries, but the same function, right? 

They are linked to two different import libraries, but they actually
link dynamically to the same dynamic link library Python23.dll.

The reason you have to use two different .lib files is that MSVC and
Borland uses two different .lib file formats. The .dll format is
defined by the operating system so that format is fixed.



-- 

Vennlig hilsen 

Syver Enstad




More information about the Python-list mailing list