No match for functions calls with default arguments

Started by
2 comments, last by CmpDev 15 years, 3 months ago
Hi! I've just got a mac book yesterday and I'm trying to port a PocketPC game I made to the iPhone. The game uses the EDGELIB library, which provides a common interface for PocketPC, iPhone and a whole bunch of other devices so all I need to do to build the iPhone version is compile the game's source code. So far I've used an existing XCode project and added my source files, but I'm getting a weird error that, after googling for a while, haven't been able to solve. The problem is that I'm getting error messages from gcc in those places where there are function calls to class methods that have default arguments. For example: "error: no matching function for call to 'CSpriteManager::Render(E2DSurfaceRGBA *, RectangleT)' and then it lists all the possible candidates. Indeed, one of the candidates (the one that should be called) is int CSpriteManager::Render(E2DSurfaceRGBA *, RectangleT &, float, int, long unsigned int). As I've said earlier, I've been googling around for a while but I haven't been able to find a solution. Any tip of how can I solve this? Thanks in advance for your help! --Nacho
Advertisement
Nevermind, after some more googling I've found out that gcc is much more restrictive than Visual Studio when it comes to function parameters which are references, so I've solved it by adding the const keyword when appropriate.

--Nacho
Binding an rvalue to a non-const reference is a MSVC non standard extension. You can enable or disable this behavior with the /Za command line switch.
Quote:Original post by SiCrane
Binding an rvalue to a non-const reference is a MSVC non standard extension. You can enable or disable this behavior with the /Za command line switch.

Good luck getting anything which includes the microsoft sdk when using this compiler option. There should be an option to only enable it in user code such as gcc has by using __extension__ in system headers.

Maybe their is a way yet I do not personally know, which is why I find /Za pretty useless.

This topic is closed to new replies.

Advertisement