Skip to main content
GameDev.net gamedev.net
🔒 Locked

Ambiguous call to overloaded function, help please.

Started by caffeineaddict Apr 7, 2003 at 12:44 AM 1 replies 14.9k views
Original Post
caffeineaddict
caffeineaddict
I''m writing a utility for an existing game and write now i''m trying to write data into a MessageBox, right now, i have a function that gets the data I need and puts it in a MessageBox, however, when i call the function anywhere, it has the error Ambiguous call to overloaded function. What exactly does this mean and how can i solve the problem?
FunkyTune
FunkyTune
It means that the compiler can't determine which of the overloaded functions you want to call. This can happen if you for exemple have done something similar to this:


void myFunction(double inputData);
void myFunction(int inputData);

long myVariable=5;
//Error! Which one should it be?
myFunction(myVariable);

//This should solve it
myFunction((double)myVariable); //Now the compiler knows which one you mean


Hope that helps

/John

[edited by - FunkyTune on April 7, 2003 1:50:14 AM]
/John
caffeineaddict
caffeineaddict
Thanks for the quick response, it did fix my problem, i had mistakenly defined it in one of the header files and this was apparently the problem because when i deleted it, it worked again, thanks again!

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.