win32 debugging-- python21_d.dll not found
John J. Lee
jjl at pobox.com
Tue Jan 29 17:26:51 EST 2002
On Fri, 25 Jan 2002, Mark Hammond wrote:
> John J. Lee wrote:
> > I compiled python21_d.dll and python21_d.exe with MSVC, and stuck the
> > _d.dll in C:\winnt\system32 along with python.dll, and the _d.exe in
> > C:\Python21, alongside python.exe. When I try using python_d.exe, with an
> > extension compiled with mingw32 against libpython21_d.a, I get a message
> > box complaining that python21_d.dll couldn't be found, yet
> > C:\winnt\system32 is listed in the search path given in that very message
> > box. Are DLLs not found by filename? Or what?
>
> Check that all dependent modules can be found. Use the free "depends"
> tool to determine what other DLLs have been referenced by python21_d.dll
> are available.
Well, the only direct dependencies of python21_d according to depends.exe
are (as I'm sure you know!) standard windows dlls: kernel32, user32,
advapi32, shell32 and msvcrtd.
However:
1. I just realised that the error only occurs on importing the extension
module, not on starting python_d.exe itself, which runs quite happily
in interactive mode until you import _recode.
2. If, instead of looking at the python21_d DLL, I look at _recode_d.dll
in depends.exe, I get a dependency on PYTHON21_D with a big question
mark icon to the left of it.
I was under the impression that Python on Windows resided essentially in
the DLL. If I have that correct, then since python_d.exe works fine in
interactive mode presumably the problem is with the _recode module rather
than my system setup. Not exactly a helpful error from Windows...
So, why does depends.exe complain about _recode's dependency on
python21_d, when it seems quite happy with python21_d itself, and when,
what's more, they both sit in the very same directory (C:\winnt\system32)?
I guess if I knew that I'd know why I get the error on importing _recode
with python_d.exe. I'm guessing this is related to the fact that the
extension was compiled with mingw, but exactly how, I'm not sure.
The extension module in question (_recode) does import ok on windows when
compiled against the non-debugging python, though it causes a memory
access error on actually using it (after my little test routine finishes
without error, around when the interpreter exits, though I don't know
exactly when this happens, obviously, since I haven't been able to debug
it yet). Since this is somebody else's extension, written by someone more
competent with C than me, and given also the fact that it works fine on
unix, I suspect some cockup by yours truly is causing this, but what it
might be I don't know.
I've tried both a version (of the debugging DLL and .exe) I compiled
myself with MSVC, and using the standard distribution of debugging libs.
I'm using the standard python.org windows Python 2.1.1 distribution. I'm
restricted to mingw for the extension itself because I haven't got MSVC to
compile it yet.
The error text is as follows (typed in by hand since it seems not to be
possible to cut-and-paste the damn thing):
The dynamic link library python21_d could not be found in the specified path
c:\Python21\DLLs;;C:\WINNT\System32;C:\WINNT\system;C\WINNT;d:\ProgramFiles\mingw\bin;
...etc., and from Python:
$ //c/Python21/python_d.exe
>>>
Adding parser accelerators ...
Done.
Python 2.1.1 (#20, Jul 20 2001, 01:19:59) [MSC 32 bit (Intel)] on win32
Type "copyright", "credits" or "license" for more information.
>>> import _recode
Traceback (most recent call last):
File "<stdin>", line 1, in ?
ImportError: DLL load failed: The specified module could not be found.
[5430 refs]
>>>
Thanks for any help!
John
More information about the Python-list
mailing list