Compiling extension with Visual C++ Toolkit Compiler - MSVCR80.dll

A

alexandre_irrthum

Hi there,

I am trying to install a Python library with a C extension (the
Polygon library) and I am having a bad time. My Python version is
Python 2.4.3 - Enthought Edition 1.0.0 (#69, Aug 2 2006, 12:09:59)
[MSC v.1310 32 bit (Intel)] on Windows XP Pro. I have dutifully
followed the instructions here:

http://wiki.python.org/moin/Building_Python_with_the_free_MS_C_Toolkit

i.e.,

- Installed Microsoft Visual C++ Toolkit Compiler 2003
- Installed Microsoft Platform SDK for Windows Server 2003 R2
- Installed Microsoft .NET Framework SDK, version 1.1
- setup the path, include and lib environment variables with a .bat
file, as described in the wiki document

The library seems to build correctly (producing Polygon.py and
cPolygon.pyd), but when I import it I get the following message from
python.exe: "This application has failed to start because MSVCR80.dll
was not found". I thought that this might be due to Python trying to
link against the .dll from Microsoft Visual C++ Express 2005, also
installed on my PC, instead of MSVCR71.dll. So I've removed MS Visual C
++ Express 2005, and any trace of it from my environment variables,
but that doesn't seem to change anything.

Any help would be greatly appreciated.

Regards,

alex
 
?

=?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=

The library seems to build correctly (producing Polygon.py and
cPolygon.pyd), but when I import it I get the following message from
python.exe: "This application has failed to start because MSVCR80.dll
was not found". I thought that this might be due to Python trying to
link against the .dll from Microsoft Visual C++ Express 2005, also
installed on my PC, instead of MSVCR71.dll. So I've removed MS Visual C
++ Express 2005, and any trace of it from my environment variables,
but that doesn't seem to change anything.

Any help would be greatly appreciated.

Can you find out where msvcrt.lib comes from? If you manage to copy
the linker command line, I think link.exe has a way of telling you
where it picked up the file. If that won't work, and you find multiple
copies of msvcrt.lib on your disk, you can use dumpbin /all on
each of them to find out which one is right.

Regards,
Martin
 
P

Peter Wang

The library seems to build correctly (producing Polygon.py and
cPolygon.pyd), but when I import it I get the following message from
python.exe: "This application has failed to start because MSVCR80.dll
was not found". I thought that this might be due to Python trying to
link against the .dll from Microsoft Visual C++ Express 2005, also
installed on my PC, instead of MSVCR71.dll. So I've removed MS Visual C
++ Express 2005, and any trace of it from my environment variables,
but that doesn't seem to change anything.

Alex, I'm not familiar with the particular problem you're seeing, but
did you try building the polygon library using the gcc that's included
with the Enthought distribution?

python setup.py build_clib build_ext --inplace --compiler=mingw32


-Peter
 
A

alexandre_irrthum

Thanks for your answers Martin and Peter,

I figured out why python.exe was asking for MSVCR80.dll. The first
time I compiled the library, MS Visual C++ Express 2005 was used
during the build (despite my PATH pointing to MS Visual C++ Toolkit
2003). When I removed Express 2005, I forgot to remove the build
directory of my library. I've also had to remove and reinstall the C++
Toolkit, the platform SDK and the .NET Framework SDK and modify
msvccompiler.py and my environment variables according to:

http://www.vrplumber.com/programming/mstoolkit/index.html

but finally it did work.

And Peter, your solution worked perfectly. A great alternative to
installing all the MS libraries.

Cheers,

alex
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,961
Messages
2,570,131
Members
46,689
Latest member
liammiller

Latest Threads

Top