"abs: ambiguous call to overloaded function" Created 4 years ago2020-01-19 19:45:59 UTC by _Vissova_ _Vissova_

Created 4 years ago2020-01-19 19:45:59 UTC by _Vissova_ _Vissova_

Posted 4 years ago2020-01-19 19:45:59 UTC Post #343646
I'm just beginning to learn coding for Half-Life using the SDK and VS2015. I'm following this tutorial and am at an immediate brick wall. I've followed the instructions to "Disable specific warnings" but I'm getting a lot of errors that say "abs: ambiguous call to overloaded function" in several .cpp's and have no clue what that means or how to fix it. The tutorial says nothing about this, and someone else left a comment about it but never got a response.
Posted 4 years ago2020-01-19 22:37:19 UTC Post #343648
I recommend starting with this tutorial instead:
https://gamebanana.com/tuts/12801

You'll be using VS 2017 instead of 2015 (actually, 2019 should also work) and a slightly updated version of the HL SDK which changed some of the C code into C++.

"abs" is a function that returns the absolute value of a number.
For example, abs(-20) would return 20. The ambiguous part means that abs(-20) can be interpreted in multiple ways. In other words, it is confused as to what this "-20" means in my example. It can be a whole number, it can be a real number, yada yada.
As for the overloaded part, don't worry about it for now.

How to fix it depends on the code that is calling that abs() function. However, I advise you to go with the tutorial I posted in the start of my post. (also, while installing VS 2017, check XP support, I believe it is required)
Admer456 Admer456If it ain't broken, don't fox it!
Posted 4 years ago2020-01-23 10:43:31 UTC Post #343683
I think I just changed them all to fabs when updating to the latest version of Visual Studio and that worked.
You must be logged in to post a response.