[Part] Build failure

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
jnxd
Posts: 951
Joined: Mon Mar 30, 2015 2:30 pm
Contact:

[Part] Build failure

Post by jnxd »

I'm getting an error when building, and just wanted to confirm if the suggested solution is what is needed or not.

Code: Select all

.../src/Mod/Part/App/GeomPlate/PointConstraintPyImp.cpp: In member function ‘virtual int Part::PointConstraintPy::PyInit(PyObject*, PyObject*)’:
.../src/Mod/Part/App/GeomPlate/PointConstraintPyImp.cpp:55:14: error: ‘unique_ptr’ is not a member of ‘std’
   55 |         std::unique_ptr<GeomPlate_PointConstraint> ptr;
      |              ^~~~~~~~~~
.../src/Mod/Part/App/GeomPlate/PointConstraintPyImp.cpp:32:1: note: ‘std::unique_ptr’ is defined in header ‘<memory>’; did you forget to ‘#include <memory>’?
   31 | #include "GeomPlate/PointConstraintPy.cpp"
  +++ |+#include <memory>
   32 | 
Just adding memory compiles. But The reason I'm asking this rather than just making a PR is:
1. There is no evidence that this include was removed anywhere.
2. This appears to compile on master, so it's possibly my PC.

Let me know if some more info is needed.
My latest (or last) project: B-spline Construction Project.
User avatar
mfro
Posts: 666
Joined: Sat Sep 23, 2017 8:15 am

Re: [Part] Build failure

Post by mfro »

jnxd wrote: Sun Jul 10, 2022 6:48 pm
Just adding memory compiles. But The reason I'm asking this rather than just making a PR is:
master does work for me without change. I think I had a similar (or the same) error recently that went away just with a complete clean and rebuild.
Cheers,
Markus
User avatar
jnxd
Posts: 951
Joined: Mon Mar 30, 2015 2:30 pm
Contact:

Re: [Part] Build failure

Post by jnxd »

mfro wrote: Sun Jul 10, 2022 6:59 pm
jnxd wrote: Sun Jul 10, 2022 6:48 pm
Just adding memory compiles. But The reason I'm asking this rather than just making a PR is:
master does work for me without change. I think I had a similar (or the same) error recently that went away just with a complete clean and rebuild.
I did a clean rebuild as well. But it didn't go away for me.
My latest (or last) project: B-spline Construction Project.
User avatar
jnxd
Posts: 951
Joined: Mon Mar 30, 2015 2:30 pm
Contact:

Re: [Part] Build failure

Post by jnxd »

@Uwe, @wmayer got any idea what's happening? With the successful compile the about info is:

Code: Select all

OS: Manjaro Linux (GNOME/gnome)
Word size of FreeCAD: 64-bit
Version: 0.21.29487 +12 (Git)
Build type: Release
Branch: sketcher-split-more-curves
Hash: 6b3d1b842e3a395ba7fc55ebfabef379758935cb
Python 3.10.5, Qt 5.15.5, Coin 4.0.1, Vtk , OCC 7.5.3
Locale: English/United States (en_US)
Installed mods: 
  * Curves 0.4.4
  * ProDarkThemePreferencePack 1.0.0
My latest (or last) project: B-spline Construction Project.
User avatar
mfro
Posts: 666
Joined: Sat Sep 23, 2017 8:15 am

Re: [Part] Build failure

Post by mfro »

My post yesterday was based on build experience with Debian, today I did the same on Ubuntu (20.04 LTS) and ran into the exact same problem.

It only went away after I completely swept my build directory and ran cmake from scratch. Now I can build again with no errors.
Cheers,
Markus
User avatar
jnxd
Posts: 951
Joined: Mon Mar 30, 2015 2:30 pm
Contact:

Re: [Part] Build failure

Post by jnxd »

mfro wrote: Mon Jul 11, 2022 7:44 am My post yesterday was based on build experience with Debian, today I did the same on Ubuntu (20.04 LTS) and ran into the exact same problem.

It only went away after I completely swept my build directory and ran cmake from scratch. Now I can build again with no errors.
Was your error because of a lack of unique_ptr or some boost failure? Because I see the latter every so often as well.
My latest (or last) project: B-spline Construction Project.
User avatar
mfro
Posts: 666
Joined: Sat Sep 23, 2017 8:15 am

Re: [Part] Build failure

Post by mfro »

jnxd wrote: Mon Jul 11, 2022 7:53 am Was your error because of a lack of unique_ptr or some boost failure? Because I see the latter every so often as well.
The exact same than yours: apparently missing include of memory.h
Cheers,
Markus
User avatar
jnxd
Posts: 951
Joined: Mon Mar 30, 2015 2:30 pm
Contact:

Re: [Part] Build failure

Post by jnxd »

mfro wrote: Mon Jul 11, 2022 7:54 am
jnxd wrote: Mon Jul 11, 2022 7:53 am Was your error because of a lack of unique_ptr or some boost failure? Because I see the latter every so often as well.
The exact same than yours: apparently missing include of memory.h
Weird. I did the same but the issue still repeated. Does it have something to do with build type?
My latest (or last) project: B-spline Construction Project.
wmayer
Founder
Posts: 20309
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: [Part] Build failure

Post by wmayer »

When looking at the git history then in the recent days a lot of includes has been removed in dozens of files. So, in one of the commits a header is not included any more that includes <memory> where the unique_ptr is defined. So, to fix the build failure just do what you did and add the missing file to PointConstraintPyImp.cpp
wmayer
Founder
Posts: 20309
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: [Part] Build failure

Post by wmayer »

Post Reply