Ticket #12289 (closed Bugs: fixed)

Opened 11 months ago

Last modified 9 months ago

Compile errors if you include boost/geometry/algorithms/buffer.hpp directly

Reported by: phelippeneveu@… Owned by: barendgehrels
Milestone: Boost 1.62.0 Component: geometry
Version: Boost 1.61.0 Severity: Regression
Keywords: cout Cc:


If you include boost/geometry/algorithms/buffer.hpp directly in Boost 1.61.0, you will get compile errors about cout not being part of std. The same was ok in Boost 1.58.0. There seems to be a missing include to iostream somewhere.


Change History

comment:1 Changed 10 months ago by Tony Lewis <tonyelewis@…>

I'm also seeing this problem with boost/geometry/algorithms/comparable_distance.hpp.

Using the latest commit (3ce8872) of the develop branch of the GitHub boostorg/geometry repo (and Boost 1.61.0 for the other libraries), both of the following commands fail:

g++     -x c++ -isystem include -isystem /opt/boost_1_61_0_gcc_build/include   include/boost/geometry/algorithms/comparable_distance.hpp
clang++ -x c++ -isystem include -isystem /opt/boost_1_61_0_clang_build/include include/boost/geometry/algorithms/comparable_distance.hpp

This violates the Boost header policy, which requires:

Make sure that a translation unit consisting of just the contents of the header file will compile successfully.

The Clang errors are:

In file included from include/boost/geometry/algorithms/comparable_distance.hpp:23:
In file included from include/boost/geometry/algorithms/detail/comparable_distance/implementation.hpp:22:
In file included from include/boost/geometry/algorithms/detail/distance/implementation.hpp:25:
In file included from include/boost/geometry/algorithms/detail/distance/multipoint_to_geometry.hpp:26:
In file included from include/boost/geometry/algorithms/detail/distance/range_to_geometry_rtree.hpp:25:
In file included from include/boost/geometry/algorithms/detail/closest_feature/range_to_range.hpp:22:
In file included from include/boost/geometry/index/rtree.hpp:30:
In file included from include/boost/geometry/algorithms/touches.hpp:32:
In file included from include/boost/geometry/algorithms/detail/overlay/overlay.hpp:27:
In file included from include/boost/geometry/algorithms/detail/overlay/enrich_intersection_points.hpp:30:
include/boost/geometry/algorithms/detail/overlay/handle_colocations.hpp:201:10: error: no member named 'cout' in namespace 'std'
    std::cout << " TODO: merge " << cid0 << " and " << cid1 << std::endl;
include/boost/geometry/algorithms/detail/overlay/handle_colocations.hpp:320:26: error: no member named 'cout' in namespace 'std'
                    std::cout << " CONFLICT " << std::endl;
2 errors generated.

comment:2 Changed 10 months ago by barendgehrels

  • Status changed from new to closed
  • Resolution set to fixed
  • Milestone changed from To Be Determined to Boost 1.62.0

Thanks, it is fixed - we should not std::cout unless in define-conditional blocks

comment:3 Changed 9 months ago by Tony Lewis <tonyelewis@…>

Yep - this works for me.

That said, I've found that other Geometry headers fail to compile independently and I've opened ticket:12393 about that.

Thanks very much for your work on this ticket.


Add a comment

Modify Ticket

Change Properties
<Author field>
as closed
The resolution will be deleted. Next status will be 'reopened'

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.