Compilation error with boost 1.77

After upgrading to boost 1.77, GPlates fails to compile with

/build/gplates_2.3.0_src/src/gui/TopologyTools.cc: In member function 'boost::optional<__gnu_cxx::__normal_iterator<const GPlatesGui::TopologyTools::VisibleSection*, std::vector<GPlatesGui::TopologyTools::VisibleSection> > > GPlatesGui::TopologyTools::is_section_visible_boundary(std::vector<GPlatesGui::TopologyTools::SectionInfo>::size_type) const':
/build/gplates_2.3.0_src/src/gui/TopologyTools.cc:3451: error: '_1' was not declared in this scope
 3451 |      boost::bind(&VisibleSection::d_section_info_index, _1) ==
      | 
/build/gplates_2.3.0_src/src/gui/TopologyTools.cc:3451: note: suggested alternatives:
In file included from include/boost/mpl/aux_/include_preprocessed.hpp:37,
                 from include/boost/mpl/placeholders.hpp:43,
                 from include/boost/iterator/iterator_categories.hpp:16,
                 from include/boost/iterator/iterator_adaptor.hpp:14,
                 from include/boost/iterator/reverse_iterator.hpp:10,
                 from include/boost/range/reverse_iterator.hpp:21,
                 from include/boost/range/rend.hpp:19,
                 from include/boost/foreach.hpp:82,
                 from /build/gplates_2.3.0_src/src/gui/TopologyTools.cc:33:
include/boost/mpl/aux_/preprocessed/gcc/placeholders.hpp:29:16: note:   'mpl_::_1'
In file included from include/boost/utility/compare_pointees.hpp:15,
                 from include/boost/optional/optional.hpp:55,
                 from include/boost/optional.hpp:15,
                 from /build/gplates_2.3.0_src/src/gui/TopologyTools.cc:38:
/nix/store/v819nrv8d33ns36gm4v9vqydq1v95axi-gcc-10.3.0/include/c++/10.3.0/functional:221:34: note:   'std::placeholders::_1'
  221 |     extern const _Placeholder<1> _1;
      |                                  ^~
In file included from include/boost/mpl/aux_/include_preprocessed.hpp:37,
                 from include/boost/mpl/placeholders.hpp:43,
                 from include/boost/iterator/iterator_categories.hpp:16,
                 from include/boost/iterator/iterator_adaptor.hpp:14,
                 from include/boost/iterator/reverse_iterator.hpp:10,
                 from include/boost/range/reverse_iterator.hpp:21,
                 from include/boost/range/rend.hpp:19,
                 from include/boost/foreach.hpp:82,
                 from /build/gplates_2.3.0_src/src/gui/TopologyTools.cc:33:
include/boost/mpl/aux_/preprocessed/gcc/placeholders.hpp:29:16: note:   'mpl_::_1'
In file included from include/boost/bind/bind.hpp:2336,
                 from /build/gplates_2.3.0_src/src/utils/ReferenceCount.h:29,
                 from /build/gplates_2.3.0_src/src/model/WeakReferenceCallback.h:35,
                 from /build/gplates_2.3.0_src/src/model/WeakReference.h:37,
                 from /build/gplates_2.3.0_src/src/model/Model.h:29,
                 from /build/gplates_2.3.0_src/src/model/BasicHandle.h:39,
                 from /build/gplates_2.3.0_src/src/model/FeatureHandle.h:35,
                 from /build/gplates_2.3.0_src/src/gui/TopologySectionsContainer.h:37,
                 from /build/gplates_2.3.0_src/src/gui/TopologyTools.h:37,
                 from /build/gplates_2.3.0_src/src/gui/TopologyTools.cc:54:
include/boost/bind/placeholders.hpp:58:38: note:   'boost::placeholders::_1'
In file included from include/boost/mpl/aux_/include_preprocessed.hpp:37,
                 from include/boost/mpl/placeholders.hpp:43,
                 from include/boost/iterator/iterator_categories.hpp:16,
                 from include/boost/iterator/iterator_adaptor.hpp:14,
                 from include/boost/iterator/reverse_iterator.hpp:10,
                 from include/boost/range/reverse_iterator.hpp:21,
                 from include/boost/range/rend.hpp:19,
                 from include/boost/foreach.hpp:82,
                 from /build/gplates_2.3.0_src/src/gui/TopologyTools.cc:33:
include/boost/mpl/aux_/preprocessed/gcc/placeholders.hpp:29:16: note:   'mpl_::_1'
In file included from include/boost/lambda/bind.hpp:15,
                 from /build/gplates_2.3.0_src/src/gui/TopologyTools.cc:35:
include/boost/lambda/core.hpp:71:60: note:   'boost::lambda::{anonymous}::_1'
/build/gplates_2.3.0_src/src/gui/TopologyTools.cc: In member function 'boost::optional<__gnu_cxx::__normal_iterator<const GPlatesGui::TopologyTools::VisibleSection*, std::vector<GPlatesGui::TopologyTools::VisibleSection> > > GPlatesGui::TopologyTools::is_section_visible_interior(std::vector<GPlatesGui::TopologyTools::SectionInfo>::size_type) const':
/build/gplates_2.3.0_src/src/gui/TopologyTools.cc:3470: error: '_1' was not declared in this scope
 3470 |      boost::bind(&VisibleSection::d_section_info_index, _1) ==
      | 
/build/gplates_2.3.0_src/src/gui/TopologyTools.cc:3470: note: suggested alternatives:
In file included from include/boost/mpl/aux_/include_preprocessed.hpp:37,
                 from include/boost/mpl/placeholders.hpp:43,
                 from include/boost/iterator/iterator_categories.hpp:16,
                 from include/boost/iterator/iterator_adaptor.hpp:14,
                 from include/boost/iterator/reverse_iterator.hpp:10,
                 from include/boost/range/reverse_iterator.hpp:21,
                 from include/boost/range/rend.hpp:19,
                 from include/boost/foreach.hpp:82,
                 from /build/gplates_2.3.0_src/src/gui/TopologyTools.cc:33:
include/boost/mpl/aux_/preprocessed/gcc/placeholders.hpp:29:16: note:   'mpl_::_1'
In file included from include/boost/utility/compare_pointees.hpp:15,
                 from include/boost/optional/optional.hpp:55,
                 from include/boost/optional.hpp:15,
                 from /build/gplates_2.3.0_src/src/gui/TopologyTools.cc:38:
/nix/store/v819nrv8d33ns36gm4v9vqydq1v95axi-gcc-10.3.0/include/c++/10.3.0/functional:221:34: note:   'std::placeholders::_1'
  221 |     extern const _Placeholder<1> _1;
      |                                  ^~
In file included from include/boost/mpl/aux_/include_preprocessed.hpp:37,
                 from include/boost/mpl/placeholders.hpp:43,
                 from include/boost/iterator/iterator_categories.hpp:16,
                 from include/boost/iterator/iterator_adaptor.hpp:14,
                 from include/boost/iterator/reverse_iterator.hpp:10,
                 from include/boost/range/reverse_iterator.hpp:21,
                 from include/boost/range/rend.hpp:19,
                 from include/boost/foreach.hpp:82,
                 from /build/gplates_2.3.0_src/src/gui/TopologyTools.cc:33:
include/boost/mpl/aux_/preprocessed/gcc/placeholders.hpp:29:16: note:   'mpl_::_1'
In file included from include/boost/bind/bind.hpp:2336,
                 from /build/gplates_2.3.0_src/src/utils/ReferenceCount.h:29,
                 from /build/gplates_2.3.0_src/src/model/WeakReferenceCallback.h:35,
                 from /build/gplates_2.3.0_src/src/model/WeakReference.h:37,
                 from /build/gplates_2.3.0_src/src/model/Model.h:29,
                 from /build/gplates_2.3.0_src/src/model/BasicHandle.h:39,
                 from /build/gplates_2.3.0_src/src/model/FeatureHandle.h:35,
                 from /build/gplates_2.3.0_src/src/gui/TopologySectionsContainer.h:37,
                 from /build/gplates_2.3.0_src/src/gui/TopologyTools.h:37,
                 from /build/gplates_2.3.0_src/src/gui/TopologyTools.cc:54:
include/boost/bind/placeholders.hpp:58:38: note:   'boost::placeholders::_1'
In file included from include/boost/mpl/aux_/include_preprocessed.hpp:37,
                 from include/boost/mpl/placeholders.hpp:43,
                 from include/boost/iterator/iterator_categories.hpp:16,
                 from include/boost/iterator/iterator_adaptor.hpp:14,
                 from include/boost/iterator/reverse_iterator.hpp:10,
                 from include/boost/range/reverse_iterator.hpp:21,
                 from include/boost/range/rend.hpp:19,
                 from include/boost/foreach.hpp:82,
                 from /build/gplates_2.3.0_src/src/gui/TopologyTools.cc:33:
include/boost/mpl/aux_/preprocessed/gcc/placeholders.hpp:29:16: note:   'mpl_::_1'
In file included from include/boost/lambda/bind.hpp:15,
                 from /build/gplates_2.3.0_src/src/gui/TopologyTools.cc:35:
include/boost/lambda/core.hpp:71:60: note:   'boost::lambda::{anonymous}::_1'
make[2]: *** [src/CMakeFiles/gplates-lib.dir/build.make:6210: src/CMakeFiles/gplates-lib.dir/gui/TopologyTools.cc.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:591: src/CMakeFiles/gplates-lib.dir/all] Error 2
make: *** [Makefile:156: all] Error 2

Hi dotlambda,

I’ve sent you some new source code to try out.

I had missed a few places when updating for Boost 1.73+ (somehow most systems managed to compile, but not boost 1.77 I guess).

1 Like

I’m also getting this compilation error on Boost 1.78, which was updated in my distribution’s repositories a couple of days ago. I had to rebuild GPlates to use the new library and it failed about 40% in. The previous version of Boost I had installed was 1.76; I can’t downgrade boost due to dependency issues.

Try gplates_2.3.1-beta.3_src.zip located here. It worked for dotlambda.