[Pyrex] Link error

Lenard Lindstrom len-l at telus.net
Wed Jan 10 18:41:14 UTC 2007


Natsagdorj Shagdar wrote:
> Hi list?
>
> One of my functions in my pyrex file should be loaded from DLL library.
> But when I compile, I recieve "unresolved external symbol _xxx" LINK error.
> The DLL file exists in same folder with my pyx file.
> How can I link it?  ( I'm building my module using Distutils on Windows with MS VS2005)
>
>   

Did you tell the linker about the DLL? See section 2.3.4 of 
"Distributing Python Modules" on how to specify a library in a setup.py 
file.

An aside. Python is built with VS2003 and so uses msvcr71.dll as its C 
standard library.  I don't know how it will behave with an extension 
module linked to msvcr80.dll . In fact, I am surprised Distutils 
recognizes VS2005. But you should be safe unless your module does 
something extreme like call free() on memory allocated by Python's 
PyMem_Malloc() or fread() on a (FILE *) retrieved from a Python file 
instance.

-- 
Lenard Lindstrom
<len-l at telus.net>





More information about the Pyrex mailing list