I have a small c++ project I’ve been working on in XCode, that I’d like to do some work with on my Windows machine, on Visual Studio. I made a new project and copied all of the source files into the new project. There are no external dependencies.
Now, Visual Studio does not like any of my floor or ceil calls. I get the following compiler error for every call to ceil or floor.
‘ceil’: ambiguous call to overloaded
function
These functions are not overloaded, and I’ve imported math.h in the header file to this .cpp file. What gives?
It might be a collision between std::ceil and ceil (if you use an evil using namespace std).
-> Remove the using namespace and add std:: in front of every occurence.
It is possible that the compiler doesn’t know which version of ceil to use ceil(float foo) or ceil(double foo).
-> Check if the arguments of your call are well typed.