Skip to content

isfinite compilation error #214

@connormanning

Description

@connormanning
Building CXX object myProject/third/CMakeFiles/third.dir/jsoncpp.cpp.o
/home/vagrant/myProject/myProject/third/jsoncpp.cpp: In function ‘std::string Json::valueToString(double)’:
/home/vagrant/myProject/myProject/third/jsoncpp.cpp:4049:21: error: ‘isfinite’ was not declared in this scope
   if (isfinite(value)) {
                     ^
/home/vagrant/myProject/myProject/third/jsoncpp.cpp:4049:21: note: suggested alternative:
In file included from /usr/include/c++/4.8/random:38:0,
                 from /usr/include/c++/4.8/bits/stl_algo.h:65,
                 from /usr/include/c++/4.8/algorithm:62,
                 from /home/vagrant/myProject/myProject/third/jsoncpp.cpp:2398:
/usr/include/c++/4.8/cmath:596:5: note:   ‘std::isfinite’
     isfinite(_Tp __x)
     ^
make[2]: *** [myProject/third/CMakeFiles/third.dir/jsoncpp.cpp.o] Error 1
make[1]: *** [myProject/third/CMakeFiles/third.dir/all] Error 2
make: *** [all] Error 2

This is on Ubuntu Trusty, failing here (I am using an amalgamated version of SHA ed495ed). For me, replacing isfinite() with std::isfinite() at that line let me compile. However due to the cross-platform support for isfinite here this isn't the real solution.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions