making a DLL

Will Ware wware at world.std.com
Sat Dec 9 00:56:32 EST 2000


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 way
that Microsoft Visual C++ would consider invalid? (E.g., with Borland's
compiler?) Is there a fix for all this mess? Any hints appreciated, thanks.

-- 
# - - - - - - - - - - - - - - - - - - - - - - - -
# Resistance is futile. Capacitance is efficacious.
# Will Ware	email:    wware @ world.std.com



More information about the Python-list mailing list