[python-win32] Why can I compile a C extension if I replace python25.lib with python25.dll?
Jason Baker
jbaker at zeomega.com
Fri Aug 7 19:11:17 CEST 2009
On Fri, Aug 7, 2009 at 11:40 AM, Tim Roberts<timr at probo.com> wrote:
> Jason Baker wrote:
>> I've been trying to get Storm's C extensions to compile under windows.
>> For some reason, it wasn't able to find python25.dll, even if I paste
>> it directly under libs or DLLs. My theory was that it was finding
>> python25.lib (which I'm guessing is a static library) and trying to
>> use that instead.
>>
>
> No. Python25.lib is an import library. It doesn't contain any code.
> All it contains is special linker records that say "this entry point
> will be found in python25.dll at run-time".
>
> You need Python25.lib when you build the extension. You need
> Python25.dll when you run a program that uses it.
>
>> If I remove python25.lib and replace it with python25.dll, it works
>> fine. This solution doesn't really seem like a good one to me though.
>>
>
> That doesn't make sense. The linker won't use python25.dll. It can't
> -- it's not in the right format. The linker needs the .lib. Then, when
> you run the app, the DLL must be accessible somewhere. Does the build
> process try to test the extensions?
>
> --
> Tim Roberts, timr at probo.com
> Providenza & Boekelheide, Inc.
>
> _______________________________________________
> python-win32 mailing list
> python-win32 at python.org
> http://mail.python.org/mailman/listinfo/python-win32
>
Nope. I get linker errors saying it cant find a whole slew of symbols
from the Python library. I haven't been able to figure out any other
way to get it to work without replacing python25.lib with python25.dll
(from C:\WINDOWS\SYSTEM32).
If it makes any difference, I'm using MinGW to build this.
More information about the python-win32
mailing list