Advertisement

(Python/C) linking issues when extending with bool types

Started by July 18, 2004 12:35 PM
-1 comments, last by dcosborn 20 years, 4 months ago
I'm writing a Python extension module and making use of the new Bool type as a parameter/return-value for one of my getter/setter function pairs. I'm using PyBool_FromLong, PyBool_Check, and Py_True. When I compile and link with python23.lib, I get unresolved references to PyBool_Type and Py_TrueStruct. Strangely, I don't get an unresolved reference for PyBool_FromLong. PyBool_Check is a macro that uses the PyBool_Type, so that one makes sense. I'm using a number of other python C/API functions, so I seem to only be missing some bool support. Is there another library I need to link with for full bool support? Update: On further investigation, it looks like I can't access PyInt_Type either. Update: PROBLEM SOLVED! I figured the .lib must be missing some stuff so I use pexports to generate a .def file for python23.dll, then dlltool to generate a new .lib. The new lib is 400K bigger than the old one and everything compiles perfectly now. :) [Edited by - dcosborn on July 18, 2004 4:46:32 PM]

This topic is closed to new replies.

Advertisement