making a DLL

shindich at my-deja.com shindich at my-deja.com
Sat Dec 9 07:39:08 CET 2000


In article <G5ADuH.GC8 at world.std.com>,
  wware at world.std.com (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
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
>
;) 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!

Regards,

Alex Shindich
visit http://www.shindich.com/


Sent via Deja.com http://www.deja.com/
Before you buy.



More information about the Python-list mailing list