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

2021-11-15 Thread Eryk Sun
On 11/14/21, Marco Sulla wrote: > On Sun, 14 Nov 2021 at 16:42, Barry Scott wrote: > >> On macOS .dynlib and Unix .so its being extern that does this. > > And extern is the default. I understand now. Per Include/exports.h and Include/pyport.h, Python should be built in Unix with "default"

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

2021-11-14 Thread Marco Sulla
On Sun, 14 Nov 2021 at 16:42, Barry Scott wrote: > > Sorry iPad sent the message before it was complete... > > > On 14 Nov 2021, at 10:38, Marco Sulla wrote: > > > > Okay, now the problem seems to be another: I get the same "unresolved > > external link" errors, but only for internal functions.

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

2021-11-14 Thread Barry Scott
Sorry iPad sent the message before it was complete... > On 14 Nov 2021, at 10:38, Marco Sulla wrote: > > Okay, now the problem seems to be another: I get the same "unresolved > external link" errors, but only for internal functions. > > This seems quite normal. The public .lib does not expose

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

2021-11-14 Thread Marco Sulla
Okay, now the problem seems to be another: I get the same "unresolved external link" errors, but only for internal functions. This seems quite normal. The public .lib does not expose the internals of Python. The strange fact is: why can I compile it on Linux and MacOS? Their external libraries

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

2021-11-13 Thread Marco Sulla
. Sorry, the problem is I downloaded the 32 bit version of VS compiler and 64 bit version of Python.. On Sat, 13 Nov 2021 at 11:10, Barry Scott wrote: > > > > > On 13 Nov 2021, at 09:00, Barry wrote: > > > > > > > >> On 12 Nov 2021, at 22:53, Marco Sulla wrote: > >> > >> It seems that

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

2021-11-13 Thread Barry Scott
> On 13 Nov 2021, at 09:00, Barry wrote: > > > >> On 12 Nov 2021, at 22:53, Marco Sulla wrote: >> >> It seems that on Windows it doesn't find python3.lib, >> even if I put it in the path. So I get the `unresolved external link` >> errors. > > I think you need the python310.lib (not sure

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

2021-11-13 Thread Barry
> On 12 Nov 2021, at 22:53, Marco Sulla wrote: > > It seems that on Windows it doesn't find python3.lib, > even if I put it in the path. So I get the `unresolved external link` > errors. I think you need the python310.lib (not sure of file name) to get to the internal symbols. You can use

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

2021-11-12 Thread Marco Sulla
On Fri, 12 Nov 2021 at 21:09, Chris Angelico wrote: > > On Sat, Nov 13, 2021 at 7:01 AM Marco Sulla > wrote: > > On Fri, 12 Nov 2021 at 17:38, Chris Angelico wrote: > > > Are you sure that you really need Py_BUILD_CORE? > > > > Yes, because I need the internal functions of `dict`. So I need to

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

2021-11-12 Thread Chris Angelico
On Sat, Nov 13, 2021 at 7:01 AM Marco Sulla wrote: > On Fri, 12 Nov 2021 at 17:38, Chris Angelico 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. >

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

2021-11-12 Thread Marco Sulla
Chris? Maybe I'm dreaming X-D On Fri, 12 Nov 2021 at 17:38, Chris Angelico 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:

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

2021-11-12 Thread Chris Angelico
On Sat, Nov 13, 2021 at 3:28 AM Marco Sulla wrote: > > On Fri, 12 Nov 2021 at 15:55, Gisle Vanem wrote: > > Marco Sulla wrote: > > > Error LNK2001: unresolved external symbol PyErr_SetObject > > > > > > and so on. > > > > > > I post the part of my setup.py about the C Extension: > > > > > >

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

2021-11-12 Thread Marco Sulla
On Fri, 12 Nov 2021 at 15:55, Gisle Vanem wrote: > Marco Sulla wrote: > > Error LNK2001: unresolved external symbol PyErr_SetObject > > > > and so on. > > > > I post the part of my setup.py about the C Extension: > > > > extra_compile_args = ["-DPY_SSIZE_T_CLEAN", "-DPy_BUILD_CORE"] > > Shouldn't

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

2021-11-12 Thread Gisle Vanem
Marco Sulla wrote: Error LNK2001: unresolved external symbol PyErr_SetObject and so on. I post the part of my setup.py about the C Extension: extra_compile_args = ["-DPY_SSIZE_T_CLEAN", "-DPy_BUILD_CORE"] Shouldn't this be "-DPy_BUILD_CORE_MODULE"? -- --gv --

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

2021-11-12 Thread Marco Sulla
I have no problem compiling my extension under Linux and MacOS. Under Windows, I get a lot of Error LNK2001: unresolved external symbol PyErr_SetObject and so on. I post the part of my setup.py about the C Extension: extra_compile_args = ["-DPY_SSIZE_T_CLEAN", "-DPy_BUILD_CORE"] undef_macros =