Mailing List Archive

DLL load failed with SWIG DLL
I am attempting to use SWIG to create an
extension DLL for Python on a WinNT machine.

I have successfully compiled and linked my DLL,
which uses the -shadow option in SWIG. My DLL is
called Examplec, and the SWIG generated .py
module is Example.

When I attempt to import either the .py module or
the DLL itself, I get the following error:

ImportError: DLL load failed: The specified
module could not be found.

Now, I have searched all over this newsgroup and
have found similiar problems, but no one has
complained about this exact message.

Other problems have been things like not being
able to find DLLs that this DLL is dependent on,
or the DLL not having a correct init<module>
signature.

I have verified that all this looks correct. The
DLL and .py module are on the PYTHONPATH. And
the init entry point is correct. All the
dependacy DLLs can be found on the system path as
well.

I also compiled the DLL with the __WIN32__ symbol.

The only thing I question is whether or not I
built SWIG correctly. After you build SWIG you
run 'nmake install'. This installs SWIG into the
target directory.

I built SWIG on machine A, and then copied the
install directory to the exact location on
machine B.

I don't see how this could make any difference,
however, because the DLL compiles and links fine.

Has anyone seen this before, or could someone
give some suggestions? I am at a loss at to what
to try next.

Thanks in advance for your help.


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
DLL load failed with SWIG DLL [ In reply to ]
In article <7mfd42$hrq$1@nnrp1.deja.com>,
winkjj@my-deja.com wrote:
> I am attempting to use SWIG to create an
> extension DLL for Python on a WinNT machine.
>
> I have successfully compiled and linked my DLL,
> which uses the -shadow option in SWIG. My DLL is
> called Examplec, and the SWIG generated .py
> module is Example.
>
> When I attempt to import either the .py module or
> the DLL itself, I get the following error:
>
> ImportError: DLL load failed: The specified
> module could not be found.
>
> Now, I have searched all over this newsgroup and
> have found similiar problems, but no one has
> complained about this exact message.
>
> Other problems have been things like not being
> able to find DLLs that this DLL is dependent on,
> or the DLL not having a correct init<module>
> signature.
>
> I have verified that all this looks correct. The
> DLL and .py module are on the PYTHONPATH. And
> the init entry point is correct. All the
> dependacy DLLs can be found on the system path as
> well.
>
> I also compiled the DLL with the __WIN32__ symbol.
>
> The only thing I question is whether or not I
> built SWIG correctly. After you build SWIG you
> run 'nmake install'. This installs SWIG into the
> target directory.
>
> I built SWIG on machine A, and then copied the
> install directory to the exact location on
> machine B.
>
> I don't see how this could make any difference,
> however, because the DLL compiles and links fine.
>
> Has anyone seen this before, or could someone
> give some suggestions? I am at a loss at to what
> to try next.
>
> Thanks in advance for your help.
>
> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.
>

I guess I answered my own question. I was linked a against the
python15_d.dll, instead of python15.dll. Once I changed this, it
worked fine.


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.