PlotJuggler icon indicating copy to clipboard operation
PlotJuggler copied to clipboard

PJ cannot be build with modern compilers (clang-17 on Mac) due to sol2-3.3.0

Open ibrahim-aydin opened this issue 5 months ago • 3 comments

I tried to compile PlotJuggler (version 3.10.6) from source on my Mac with these properties:

  • M4 Pro
  • MacOS 15.3.1
  • clang-17.0.0

After following COMPILE.md instructions, I have been getting this error:

/.../plotjuggler_ws/src/PlotJuggler/3rdparty/sol2-3.3.0/include/sol/sol.hpp:6755:10: error: no member named 'construct' in 'optional<type-parameter-0-0 &>' 6755 | this->construct(std::forward<Args>(args)...);

After digging into the problem. I found out that sol2-3.3.0 is making illegal usage of optional by trying to construct an object inside an optional<T&>

I fixed this by cloning updated version of sol2 and editing cmake files and include directives accordingly. I can make a fork and raise a PR upon review of this issue.

ibrahim-aydin avatar Jun 11 '25 10:06 ibrahim-aydin

Also there is a problem with protobuf version. Seems like recent versions of google/protobuf/compiler/importer.h started using absl:string_view instead of std::string& and there is a change in functions of FileErrorCollector class (AddError became RecordError and AddWarning became RecordWarning)

I will make a fork and commit these changes an raise a PR ASAP

ibrahim-aydin avatar Jun 12 '25 08:06 ibrahim-aydin

Updating to Sol2 v3.5.0 allowed me to compile as well.

zdavkeos avatar Jun 14 '25 00:06 zdavkeos

I can do that upgrade...

facontidavide avatar Jun 14 '25 06:06 facontidavide

Ok now I saw that you already did that one @facontidavide

ibrahim-aydin avatar Jul 01 '25 19:07 ibrahim-aydin

Reopened as fix for support for new protobuf compilers PR (#1106 ) is ongoing

ibrahim-aydin avatar Jul 01 '25 19:07 ibrahim-aydin