When you get the ambiguous reference to a function, it usually means that you passed the wrong parameters to it. In looking at your calls to cursor, make sure you are passing the right types. If cursor(…) is not prototyped, The first call to cursor sets the types of parameters…