View previous topic :: View next topic |
Author |
Message |
Guest
|
stdlib.h compiler error |
Posted: Tue Apr 06, 2004 9:32 am |
|
|
While compiling a program, the compiler is flagging line 687 of the stdlib.h file for
Error[28] C:\PROGRAM FILES\PICC\drivers\stdlib.h 687 : Expecting an identifier
line 687 reads:
typedef signed int (*_Cmpfun)(char * p1,char * p2);
Any help would be appreciated.
Dan |
|
|
Ttelmah Guest
|
Re: stdlib.h compiler error |
Posted: Tue Apr 06, 2004 10:04 am |
|
|
Anonymous wrote: | While compiling a program, the compiler is flagging line 687 of the stdlib.h file for
Error[28] C:\PROGRAM FILES\PICC\drivers\stdlib.h 687 : Expecting an identifier
line 687 reads:
typedef signed int (*_Cmpfun)(char * p1,char * p2);
Any help would be appreciated.
Dan |
The commonest reason for this type of fault, is that something in front of the #include of stdlib, is redefining a value that the file uses. So if (for instance), you have some #defines in front of the point where you include the file, that define something called 'p1', or 'p2', you could generate this fault. Unfortunately, the 'error flaggin' of the compiler is also sometimes 'late', and the problem could be several lines before the one that is flagged.
So look carefully at what you are doing before the include.
Best Wishes |
|
|
dan king
Joined: 22 Sep 2003 Posts: 119
|
|
Posted: Tue Apr 06, 2004 11:21 am |
|
|
I've gone in and included the stdlib.h in a previous code I wrote that does compile and the stdlib.h still flags the same error on the same line number and I'm sure that I'm not using p1 or p2 in that code. Now, I'm really confused. The only line in front of the stdlib.h is the device include for 16f877.h |
|
|
dyeatman
Joined: 06 Sep 2003 Posts: 1934 Location: Norman, OK
|
|
Posted: Tue Apr 06, 2004 11:40 am |
|
|
What version are you running?
I put 16F877.h and STDLIB in a new project and compiled them with version 3.188 and had no problems so it is something in the code or compiler version you are using.
Have you by chance got an "alternate" version of the 16F877.h or stdlib.h files that are different? If you do then the compiler might be seeing them instead.... |
|
|
|