invalid use of incomplete type ‘PyInterpreterState’

Having trouble installing or compiling FreeCAD? Get help here.
Tooniis
Posts: 14
Joined: Sat Feb 17, 2018 7:29 am

invalid use of incomplete type ‘PyInterpreterState’

Postby Tooniis » Tue Mar 24, 2020 3:23 am

I got this trying to compile 0.18.4:

Code: Select all

src/Base/swigpyrun.inl:75:31: error: invalid use of incomplete type ‘PyInterpreterState’ {aka ‘struct _is’}
   75 |     PyObject *modules = interp->modules;
      |                               ^~
In file included from /usr/include/python3.8/genobject.h:11,
                 from /usr/include/python3.8/Python.h:121,
                 from /home/yassine/Code/Source/FreeCAD-0.18.4/src/Base/PyExport.h:42,
                 from /home/yassine/Code/Source/FreeCAD-0.18.4/src/Base/swigpyrun.cpp:25:
/usr/include/python3.8/pystate.h:20:8: note: forward declaration of ‘PyInterpreterState’ {aka ‘struct _is’}
   20 | struct _is;
      |        ^~~
User avatar
Kunda1
Posts: 8366
Joined: Thu Jan 05, 2017 9:03 pm

Re: invalid use of incomplete type ‘PyInterpreterState’

Postby Kunda1 » Tue Mar 24, 2020 2:15 pm

Tooniis wrote:
Tue Mar 24, 2020 3:23 am
I got this trying to compile 0.18.4:

Code: Select all

src/Base/swigpyrun.inl:75:31: error: invalid use of incomplete type ‘PyInterpreterState’ {aka ‘struct _is’}
   75 |     PyObject *modules = interp->modules;
      |                               ^~
In file included from /usr/include/python3.8/genobject.h:11,
                 from /usr/include/python3.8/Python.h:121,
                 from /home/yassine/Code/Source/FreeCAD-0.18.4/src/Base/PyExport.h:42,
                 from /home/yassine/Code/Source/FreeCAD-0.18.4/src/Base/swigpyrun.cpp:25:
/usr/include/python3.8/pystate.h:20:8: note: forward declaration of ‘PyInterpreterState’ {aka ‘struct _is’}
   20 | struct _is;
      |        ^~~
Please please please get in the habit of posting more info about your system
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
Tooniis
Posts: 14
Joined: Sat Feb 17, 2018 7:29 am

Re: invalid use of incomplete type ‘PyInterpreterState’

Postby Tooniis » Tue Mar 24, 2020 6:04 pm

Kunda1 wrote:
Tue Mar 24, 2020 2:15 pm
Please please please get in the habit of posting more info about your system
I'm sorry, but what kind of system information would help here?

Here's some information:
Arch Linux
Python 3.8.2
CMake 3.17.0
User avatar
sgrogan
Posts: 6087
Joined: Wed Oct 22, 2014 5:02 pm

Re: invalid use of incomplete type ‘PyInterpreterState’

Postby sgrogan » Tue Mar 24, 2020 10:20 pm

Tooniis wrote:
Tue Mar 24, 2020 6:04 pm
I'm sorry, but what kind of system information would help here?

Here's some information:
Arch Linux
Python 3.8.2
CMake 3.17.0
This helps, Thanks.

FreeCAD 0.18.4 was not ported to 3.8.2 and probably other newer libs (OCCT for example), because you are on ARCH you have the bleeding edge libs.
I suggest you try with the master branch.
We are in a feature freeze and hopefully will be releasing 0.19 next month. I also don't think I've seen CMake 3.17 yet.
"fight the good fight"
Tooniis
Posts: 14
Joined: Sat Feb 17, 2018 7:29 am

Re: invalid use of incomplete type ‘PyInterpreterState’

Postby Tooniis » Wed Mar 25, 2020 7:45 am

sgrogan wrote:
Tue Mar 24, 2020 10:20 pm
This helps, Thanks.

FreeCAD 0.18.4 was not ported to 3.8.2 and probably other newer libs (OCCT for example), because you are on ARCH you have the bleeding edge libs.
I suggest you try with the master branch.
We are in a feature freeze and hopefully will be releasing 0.19 next month. I also don't think I've seen CMake 3.17 yet.
Building master worked. Thanks.
User avatar
sgrogan
Posts: 6087
Joined: Wed Oct 22, 2014 5:02 pm

Re: invalid use of incomplete type ‘PyInterpreterState’

Postby sgrogan » Wed Mar 25, 2020 8:31 pm

Tooniis wrote:
Wed Mar 25, 2020 7:45 am
Building master worked. Thanks.
Great. Out of curiosity what version of QT5 do you have?
"fight the good fight"