Unable to compile my C Extension on Windows: unresolved external link errors

Chris Angelico rosuav at gmail.com
Fri Nov 12 15:07:36 EST 2021


On Sat, Nov 13, 2021 at 7:01 AM Marco Sulla
<Marco.Sulla.Python at gmail.com> wrote:
> On Fri, 12 Nov 2021 at 17:38, Chris Angelico <rosuav at gmail.com> wrote:
> > Are you sure that you really need Py_BUILD_CORE?
>
> Yes, because I need the internal functions of `dict`. So I need to
> compile also dictobject.c and include it. So I need that flag.
>
> This is the code:
>
> https://github.com/Marco-Sulla/python-frozendict.git
>

Ah, gotcha.

Unfortunately that does mean you're delving deep into internals, and a
lot of stuff that isn't designed for extensions to use. So my best
recommendation is: dig even deeper into internals, and duplicate how
the core is doing things (maybe including another header or
something). It may be that, by declaring Py_BUILD_CORE, you're getting
a macro version of that instead of the normal exported function.

ChrisA


More information about the Python-list mailing list