making a DLL

shindich at shindich at
Sat Dec 9 01:39:08 EST 2000

In article <G5ADuH.GC8 at>,
  wware at (Will Ware) wrote:
> This is admittedly a pretty dumb question, please bear with me, I'm
> not a Windows programmer. I've often made shared objects in Unix to
> speed up Python with the addition of code written in C. Now I want to
> do the equivalent thing in Windows. So I've written a dumb example
> C++ file, and put together an apparently adequate .def file, and told
> MS VC++ 5.0 to build a DLL. I even figured out how to set up the
> include directory (C:\Python20\include) so that it doesn't have any
> trouble finding Python.h. So far so good. Alas, when I try to link, I
> get this:
> Linking...
> LINK : fatal error LNK1104: cannot open file "python20_d.lib"
> Error executing link.exe.
> So I searched the directory tree starting at c:\Python20 for *.lib
> files, and found c:\Python20\libs\python20.lib, but no python20_d.lib
> anywhere. So I thought to try forcing the thing to use python20.lib
> instead (Project->Settings->Link(input)->Object/library modules) and
> gave it the library path. Now I get a different error:
> Linking...
> c:\Python20\libs\python20.lib : fatal error LNK1106: invalid file or \
>                disk full: cannot seek to 0x39ed0908
> Error executing link.exe.
> I know the disk isn't full, so I conclude that python20.lib is somehow
> deemed invalid. Was the Windows version of Python 2.0 built in some
> that Microsoft Visual C++ would consider invalid? (E.g., with
> compiler?) Is there a fix for all this mess? Any hints appreciated,
> --
> # - - - - - - - - - - - - - - - - - - - - - - - -
> # Resistance is futile. Capacitance is efficacious.
> # Will Ware	email:    wware @
;) I have seen this before.
You are building under the debug configuration. Regular Windows install
of Python installs release library only, i.e. python20.lib. The name of
the debug python library is python20_d.lib. You have two options here:
1. Build in the Release mode
2. Dowload Python sources and build them in the Debug mode. This will
produce python20_d.dll and python20_d.lib

Good luck!


Alex Shindich

Sent via
Before you buy.

More information about the Python-list mailing list