GnuCash
Contact   Instructions
Bug 798196 - not building with Boost 1.76
Summary: not building with Boost 1.76
Status: RESOLVED FIXED
Alias: None
Product: GnuCash
Classification: Unclassified
Component: General (show other bugs)
Version: 4.5
Hardware: PC Other
: Normal normal
Target Milestone: ---
Assignee: general
QA Contact: general
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-05-22 15:01 EDT by Brad Smith
Modified: 2021-06-12 20:14 EDT (History)
3 users (show)

See Also:


Attachments

Description Brad Smith 2021-05-22 15:01:52 EDT
Trying to build with Boost 1.76 it is failing like so..

/home/ports/pobj/gnucash-4.5/gnucash-4.5/libgnucash/engine/gnc-numeric.cpp:87:9: error: no member named 'isnan' in namespace 'std'; did you mean simply 'isnan'?
    if (std::isnan(d) || fabs(d) > max_leg_value)
        ^~~~~~~~~~
        isnan
/usr/include/c++/v1/math.h:545:1: note: 'isnan' declared here
isnan(long double __lcpp_x) _NOEXCEPT { return __libcpp_isnan(__lcpp_x); }
^
1 error generated.
Comment 1 John Ralls 2021-05-22 17:30:42 EDT
https://en.cppreference.com/w/cpp/numeric/math/isnan says it's a thing. Does adding
#include <cmath>
at the top of gnc-numeric.cpp fix it?

What compiler and standard C++ library?
Comment 2 Brad Smith 2021-05-22 17:33:25 EDT
Clang / libc++.

It builds just fine with Boost 1.73.

Let me try adding the header.
Comment 3 John Ralls 2021-05-22 17:42:42 EDT
(In reply to brad from comment #2)
> Clang / libc++.
> 
> It builds just fine with Boost 1.73.
> 
> Let me try adding the header.

It's a bit strange that boost would break something like that. You might have to put the new include before the boost includes.
Comment 4 Brad Smith 2021-05-22 18:21:48 EDT
I added the header below cstdlib and it built to completion.
Comment 5 John Ralls 2021-06-12 20:14:47 EDT
OK, I've pushed a commit that replaces all of the extern "C" standard C headers with their C++ equivalents and gets them all included before the boost ones.

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