GnuCash
Contact   Instructions
Bug 797748 - missing header "algorithm"
Summary: missing header "algorithm"
Status: RESOLVED FIXED
Alias: None
Product: GnuCash
Classification: Unclassified
Component: Import - CSV (show other bugs)
Version: 3.10
Hardware: PC All
: Normal major
Target Milestone: ---
Assignee: import
QA Contact: import
URL:
Whiteboard:
Keywords:
: 797751 797771 (view as bug list)
Depends on:
Blocks:
 
Reported: 2020-05-12 02:15 EDT by Thomas Klausner
Modified: 2020-05-26 00:15 EDT (History)
6 users (show)

See Also:


Attachments

Description Thomas Klausner 2020-05-12 02:15:33 EDT
After boost in pkgsrc was updated to 1.73.0, the gnucash 3.10 build stopped working.

gnucash/import-export/csv-imp/assistant-csv-price-import.cpp:270:10: error: 'replace' is not+a member of 'std'
     std::replace (mod_txt.begin(), mod_txt.end(), '[', '(');
          ^~~~~~~
gnucash/import-export/csv-imp/assistant-csv-price-import.cpp:271:10: error: 'replace' is not+a member of 'std'
     std::replace (mod_txt.begin(), mod_txt.end(), ']', ')');
          ^~~~~~~
/gnucash/import-export/csv-imp/assistant-csv-price-import.cpp: In member function 'void
+CsvImpPriceAssist::preview_reparse_col_type(GncPricePropType)':
/gnucash/import-export/csv-imp/assistant-csv-price-import.cpp:1196:41: error: no matching
+function for call to 'find(std::vector<GncPricePropType>::iterator, std::vector<GncPricePropType>::iterator, GncPricePropType&)'
                 column_types.end(), type);
                                         ^

In file included from /usr/include/g++/bits/locale_facets.h:48,
                 from /usr/include/g++/bits/basic_ios.h:37,
                 from /usr/include/g++/ios:44,
                 from /usr/include/g++/ostream:38,
                 from /usr/include/g++/iostream:39,
                 from libgnucash/engine/gnc-numeric.hpp:27,
                 from gnucash/import-export/csv-imp/gnc-imp-props-price.hpp:43,
                 from gnucash/import-export/csv-imp/gnc-imp-settings-csv-price.hpp:39,
                 from gnucash/import-export/csv-imp/assistant-csv-price-import.cpp:55:
/usr/include/g++/bits/streambuf_iterator.h:368:5: note: candidate: 'template<class _CharT2> typename
+__gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type
+std::find(std::istreambuf_iterator<_CharT>, std::istreambuf_iterator<_CharT>, const _CharT2&)'
     find(istreambuf_iterator<_CharT> __first,
     ^~~~


The fix is to include "algorithm" in the header file like this:

--- gnucash/import-export/csv-imp/gnc-imp-settings-csv.hpp.orig 2020-05-11 19:38:43.108485371 +0000
+++ gnucash/import-export/csv-imp/gnc-imp-settings-csv.hpp
@@ -34,6 +34,7 @@ extern "C" {
 #include "gnc-commodity.h"
 }

+#include <algorithm>
 #include <string>
 #include <vector>
 #include <boost/optional.hpp>


I guess it was included indirectly via a boost header before 1.73.0.
Comment 1 John Ralls 2020-05-13 15:54:54 EDT
*** Bug 797751 has been marked as a duplicate of this bug. ***
Comment 2 John Ralls 2020-05-13 15:56:04 EDT
Thanks, I decided to fix it more comprehensively as insurance against other headers popping in and out.

Pushed to maint, will be in 3.903 and 3.11.
Comment 3 John Ralls 2020-05-25 17:27:37 EDT
*** Bug 797771 has been marked as a duplicate of this bug. ***

Note You need to log in before you can comment on or make changes to this bug.