robotology / icub-tests

Contains tests for iCub robot Tests are written using the robot-testing framework
http://robotology.github.io/icub-tests/
Other
6 stars 13 forks source link

icub-tests failing because of std::isnan() and std::nanf() methods #43

Closed nunoguedelha closed 6 years ago

nunoguedelha commented 6 years ago

The project fails to compile on Macos, in the devel branch, with the error:

rc/positionControl-accuracy/PositionControlAccuracy.cpp -o /Users/nunoguedelha/dev/robotology-superbuild/build/robotology/icub-tests/src/positionControl-accuracy/iCub-Tests.build/Release/PositionControlAccuracy.build/Objects-normal/x86_64/PositionControlAccuracy.o
/Users/nunoguedelha/dev/robotology-superbuild/robotology/icub-tests/src/positionControl-accuracy/PositionControlAccuracy.cpp:108:17: error: no member named 'nanf' in namespace 'std'; did you mean simply 'nanf'?
    double p_Kp=std::nanf("");
                ^~~~~~~~~
                nanf

isnan(), nanf(), etc.., are defined in the namespacestd in the header <cmath.h> (*) but not in the header <math> (**) which is the one included in the PositionControlAccuracy.cpp file.

(*) C++ standard: https://en.cppreference.com/w/cpp/numeric/math/nan () C** stancdard: https://en.cppreference.com/w/c/numeric/math/nan

So either the include is changed to <cmath.h>, either the prefix std should be removed.

nunoguedelha commented 6 years ago

CC @traversaro

nunoguedelha commented 6 years ago

CC @valegagge

traversaro commented 6 years ago

Is this fixed by https://github.com/robotology/icub-tests/pull/44 ?

nunoguedelha commented 6 years ago

Theoretically yes. Checking...

nunoguedelha commented 6 years ago

Check done. It is fixed. Closing the issue.