Path: chuka.playstation.co.uk!news From: "JohnT" Newsgroups: scee.yaroze.programming.gnu_compiler Subject: Re: Please help with Compiler Error Date: Thu, 4 Mar 1999 00:18:41 -0800 Organization: PlayStation Net Yaroze (SCEE) Lines: 59 Message-ID: <7bkjpc$9he22@chuka.playstation.co.uk> References: <7b6p6p$9po24@chuka.playstation.co.uk> NNTP-Posting-Host: 195.166.130.117 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.0810.800 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.0810.800 Rikki Prince wrote in message news:7b6p6p$9po24@chuka.playstation.co.uk... >I've just been trying out a basic sprite viewer, and when compiling have had >the following error: > main.c:xx: declaration for parameter 'MyFunction' but no such > parameter > >where xx is the line number the error occurred, and MyFunction is one of my >functions. Also, main.c is sometimes graphics.h etc. >If anyone can tell me what the problem is in my program, I will be very >grateful. > >Thanks in advance >Rikki > This is likely to be caused when you have changed a function's parameters and not made the same change in the declaration... Usually removing a parameter. EG In the header file or at the top of the code file you might have... void MyFunction(int start, int end, int length); and for the function... void MyFunction(int start, int end) { .... } The length parameter was taken out from the function but not removed from the declaration. Another cause could be a change of parameter name in the function but again not changed in the declaration... void MyFunction(int start, int end); void MyFunction(int start, int stop) { ... } To avoid this I always leave out the parameter names in the declaration... void MyFunction(int, int); That way you can change the names without worrying about changing the declaration. Of course, you will still need to change the declaration if you change the type of a parameter or add/remove them. Hope that helps :) JohnT