Error C2668 'abs': ambiguous call to overloaded function
Triangle Renderer Project c:\demo_temp\triangle-renderer-project\triangle renderer project\c3dengine.cpp 5953
- Ambiguous overload call to abs(double)
- 3D Software Rendering Engine - Part I
The cplusplus page you cite does not say to include cmath.h. It says cmath. That's the C++ version of math.h. Don't include both. – Rob Kennedy Sep 3 '09 at 15:54
The header
very clear and thorough answer is the following one:
Since vendors don't want to maintain two versions of what is essentially the same header, they came up with different possibilities to have only one of them behind the scenes. Often, that's the C header (since a C++ compiler is able to parse that, while the opposite won't work), and the C++ header just includes that and pulls everything into namespace std. Or there's some macro magic for parsing the same header with or without namespace std wrapped around it or not. To this add that in some environments it's awkward if headers don't have a file extension (like editors failing to highlight the code etc.). So some vendors would have
That's the reason why on some platforms including things like
when I compile this project, I got this error message:
I fixed it by using their new header file names: such as bracket cmath braket instead of cmath.h;
No comments:
Post a Comment