MRPT / mrpt

:zap: The Mobile Robot Programming Toolkit (MRPT)
https://docs.mrpt.org/reference/latest/
BSD 3-Clause "New" or "Revised" License
1.94k stars 628 forks source link

Building on the MaxOSX: ambigous function call #73

Closed nemanja-jakovljevic closed 10 years ago

nemanja-jakovljevic commented 10 years ago

Error is as follows: [ 70%] Building CXX object libs/hwdrivers/CMakeFiles/mrpt-hwdrivers.dir/src/aria/src/ArAction.cpp.o In file included from //mrpt-git/libs/hwdrivers/src/aria/src/ArAction.cpp:12: In file included from //mrpt-git/libs/hwdrivers/src/aria/include/ArResolver.h:14: In file included from //mrpt-git/libs/hwdrivers/src/aria/include/ArActionDesired.h:13: //mrpt-git/libs/hwdrivers/src/aria/include/ariaUtil.h:773:31: error: call to 'abs' is ambiguous if (ms < 0 && (unsigned)std::abs(ms) > timeThis) ^~~~ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/cmath:660:1: note: candidate function abs(float x) _NOEXCEPT {return fabsf(x);} ^ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/cmath:664:1: note: candidate function abs(double x) _NOEXCEPT {return fabs(x);} ^ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/cmath:668:1: note: candidate function abs(long double __x) _NOEXCEPT {return fabsl(__x);} ^ 1 error generated. make[2]: * [libs/hwdrivers/CMakeFiles/mrpt-hwdrivers.dir/src/aria/src/ArAction.cpp.o] Error 1 make[1]: * [libs/hwdrivers/CMakeFiles/mrpt-hwdrivers.dir/all] Error 2 make[1]: *\ Waiting for unfinished jobs....

---- until - here ---- Solved by casting ms to double in file libs/hwdrivers/src/aria/include/ariaUtil.h line 773 if (ms < 0 && (unsigned)std::abs((double)ms) > timeThis)

After that - build succeeded.

jlblancoc commented 10 years ago

Thanks!