Agui icon indicating copy to clipboard operation
Agui copied to clipboard

error: call of overloaded ‘abs(double&)’ is ambiguous

Open psionic12 opened this issue 6 years ago • 2 comments

I got this when building:

/home/liu/source/Agui/src/Agui/Gui.cpp: In member function ‘void agui::Gui::processInertia()’: /home/liu/source/Agui/src/Agui/Gui.cpp:1931:32: error: call of overloaded ‘abs(double&)’ is ambiguous if(abs(touchInertia) < 0.1) ^ In file included from /usr/include/c++/6/cstdlib:75:0, from /usr/include/c++/6/stdlib.h:36, from /home/liu/source/Agui/include/Agui/BaseTypes.hpp:44, from /home/liu/source/Agui/include/Agui/Graphics.hpp:45, from /home/liu/source/Agui/include/Agui/Gui.hpp:44, from /home/liu/source/Agui/src/Agui/Gui.cpp:41: /usr/include/stdlib.h:774:12: note: candidate: int abs(int) extern int abs (int __x) __THROW attribute ((const)) __wur; ^~~ In file included from /usr/include/c++/6/stdlib.h:36:0, from /home/liu/source/Agui/include/Agui/BaseTypes.hpp:44, from /home/liu/source/Agui/include/Agui/Graphics.hpp:45, from /home/liu/source/Agui/include/Agui/Gui.hpp:44, from /home/liu/source/Agui/src/Agui/Gui.cpp:41: /usr/include/c++/6/cstdlib:185:3: note: candidate: __int128 std::abs(__int128) abs(__GLIBCXX_TYPE_INT_N_0 __x) { return __x >= 0 ? __x : -__x; } ^~~ /usr/include/c++/6/cstdlib:180:3: note: candidate: long long int std::abs(long long int) abs(long long __x) { return __builtin_llabs (__x); } ^~~ /usr/include/c++/6/cstdlib:172:3: note: candidate: long int std::abs(long int) abs(long __i) { return __builtin_labs(__i); } ^~~

I fixed this by changing all ads(double) to fabs, but I think I should report this issue any way.

psionic12 avatar Dec 06 '18 09:12 psionic12

Could you submit a PR?

jmasterx avatar Dec 14 '18 16:12 jmasterx

I'm sorry I do not have the commit any more, i just find out where the abs(double) used and change them to fabs(double)

psionic12 avatar Dec 17 '18 02:12 psionic12