← Back to team overview

kicad-developers team mailing list archive

[PATCH] boost (included in kicad) compatibility with gcc 4.7.0 - 'gtlsort' was not declared in this scope

 

Hi everyone,

after some trouble building current kicad-bzr (3491 and 3494) I found the time to investigate today. Seems there is - apart from the well-documented --with-gnomeprint-requirement in wxgtk - an incompatibility in the boost-library included in the kicad-tree with gcc 4.7.0 (at least the archlinux build) leading to the build error at the end of this email (*)

This is fixed by the attached patch which moves the include for gtlsort further up the include chain, if I understood https://bugzilla.redhat.com/show_bug.cgi?id=784654 correctly. (I don't claim any kind of "ownership" on the patch, just reproduced it from the Redhat Bug above)

With best regards and please let me know if I messed up the patch somehow,

Heiko

(*) Build error (C&P from terminal window, make -j3 so I'm not sure the message order is accurate) [ 70%] Building CXX object eeschema/CMakeFiles/eeschema.dir/dialogs/dialog_lib_edit_draw_item_base.cpp.o In file included from /tmp/packerbuild-1000/kicad-bzr/kicad-bzr/src/kicad/include/boost/polygon/polygon.hpp:64:0, from /tmp/packerbuild-1000/kicad-bzr/kicad-bzr/src/kicad/pcbnew/./polygons_defs.h:9, from /tmp/packerbuild-1000/kicad-bzr/kicad-bzr/src/kicad/pcbnew/board_items_to_polygon_shape_transform.cpp:11: /tmp/packerbuild-1000/kicad-bzr/kicad-bzr/src/kicad/include/boost/polygon/polygon_90_set_data.hpp: In instantiation of ‘void boost::polygon::polygon_90_set_data<T>::sort() const [with T = int]’: /tmp/packerbuild-1000/kicad-bzr/kicad-bzr/src/kicad/include/boost/polygon/polygon_45_set_data.hpp:1678:7: required from ‘void boost::polygon::polygon_45_set_data<Unit>::applyAdaptiveUnary_() const [with int op = 0; Unit = int]’ /tmp/packerbuild-1000/kicad-bzr/kicad-bzr/src/kicad/include/boost/polygon/polygon_45_set_data.hpp:1220:7: required from ‘bool boost::polygon::polygon_45_set_data<Unit>::clean() const [with Unit = int]’ /tmp/packerbuild-1000/kicad-bzr/kicad-bzr/src/kicad/include/boost/polygon/detail/polygon_set_view.hpp:18:9: required from ‘void boost::polygon::polygon_set_data<T>::clean() const [with T = int]’ /tmp/packerbuild-1000/kicad-bzr/kicad-bzr/src/kicad/include/boost/polygon/polygon_set_concept.hpp:56:7: required from ‘typename boost::enable_if<typename boost::polygon::gtl_and<typename boost::polygon::is_mutable_polygon_set_type<polygon_set_type_1>::type, typename boost::polygon::is_any_polygon_set_type<polygon_set_type_2>::type>::type, polygon_set_type_1>::type& boost::polygon::assign(polygon_set_type_1&, const polygon_set_type_2&) [with polygon_set_type_1 = boost::polygon::polygon_set_data<int>; polygon_set_type_2 = std::vector<boost::polygon::polygon_data<int> >; typename boost::enable_if<typename boost::polygon::gtl_and<typename boost::polygon::is_mutable_polygon_set_type<polygon_set_type_1>::type, typename boost::polygon::is_any_polygon_set_type<polygon_set_type_2>::type>::type, polygon_set_type_1>::type = boost::polygon::polygon_set_data<int>]’ /tmp/packerbuild-1000/kicad-bzr/kicad-bzr/src/kicad/include/boost/polygon/polygon_set_concept.hpp:159:5: required from ‘typename boost::enable_if<typename boost::polygon::is_mutable_polygon_set_type<polygon_set_type_1>::type, polygon_set_type>::type& boost::polygon::resize(polygon_set_type&, coord_type, bool, int) [with polygon_set_type = std::vector<boost::polygon::polygon_data<int> >; coord_type = int; typename boost::enable_if<typename boost::polygon::is_mutable_polygon_set_type<polygon_set_type_1>::type, polygon_set_type>::type = std::vector<boost::polygon::polygon_data<int> >]’ /tmp/packerbuild-1000/kicad-bzr/kicad-bzr/src/kicad/include/boost/polygon/polygon_set_concept.hpp:428:33: required from ‘typename boost::enable_if<typename boost::polygon::gtl_and_3<boost::polygon::operators::y_ps_rpe, typename boost::polygon::is_mutable_polygon_set_type<polygon_set_type_1>::type, typename boost::polygon::gtl_same_type<typename boost::polygon::geometry_concept<T2>::type, boost::polygon::coordinate_concept>::type>::type, geometry_type_1>::type& boost::polygon::operators::operator+=(geometry_type_1&, coordinate_type_1) [with geometry_type_1 = std::vector<boost::polygon::polygon_data<int> >; coordinate_type_1 = int; typename boost::enable_if<typename boost::polygon::gtl_and_3<boost::polygon::operators::y_ps_rpe, typename boost::polygon::is_mutable_polygon_set_type<polygon_set_type_1>::type, typename boost::polygon::gtl_same_type<typename boost::polygon::geometry_concept<T2>::type, boost::polygon::coordinate_concept>::type>::type, geometry_type_1>::type = std::vector<boost::polygon::polygon_data<int> >]’ /tmp/packerbuild-1000/kicad-bzr/kicad-bzr/src/kicad/pcbnew/board_items_to_polygon_shape_transform.cpp:195:33: required from here /tmp/packerbuild-1000/kicad-bzr/kicad-bzr/src/kicad/include/boost/polygon/polygon_90_set_data.hpp:299:9: error: ‘gtlsort’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]

--
eMails verschlüsseln mit PGP - privacy is your right!
Mein PGP-Key zur Verifizierung: http://pgp.mit.edu

--- include/boost/polygon/polygon.hpp.orig	2012-04-09 00:08:34.118137034 +0200
+++ include/boost/polygon/polygon.hpp	2012-04-09 00:08:57.718009182 +0200
@@ -24,6 +24,8 @@
 #include "transform.hpp"
 #include "detail/transform_detail.hpp"
 
+#include "detail/polygon_sort_adaptor.hpp"
+
 //interval
 #include "interval_data.hpp"
 #include "interval_traits.hpp"