5
// Preprocessor directive mention in <> formate :
#include "stdio.h"
#include "stdlib.h"
#include "math.h"
#include "string.h"
#include "limits.h"
#include "stddef.h"
#include "stdint.h"
...
int main()
{
 FILE *fin, *fout;  //Error[Pe020]: identifier "FILE" is undefined
 ...
 ...
 ...
 fprintf(stderr, "%s\n", opus_get_version_string());              
                         //Error[Pe020]: identifier "stderr" is undefined 

}

As per above code I got an two Errors :

1) "Error[Pe020]: identifier "FILE" is undefined"

when I found stdlib.h then there are no any kind of "FILE" directive define or typedef. So,please tell me which changes needed in stdlib.h or stdio.h

2) Error[Pe020]: identifier "stderr" is undefined

So,In which header file stderr define ?

Please tell me How to solve above errors ?

Thanks in advance.

Pratik
  • 53
  • 1
  • 6

2 Answers2

3

First, FILE is in stdio.h not in stdlib.h. Second, the default library does not include FILE support since this feature uses a lot of space and is seldom needed in embedded systems. To use FILE you must switch to full libraries in the configuration dialog (if you use the IDE) or by using the command line switch --dlib full (if you use the compiler from the command line).

Note that the full library is much larger than the normal library so if the only use of FILE is to print diagnostic messages to stderr I suggest that you use some other way of presenting the messages.

Johan
  • 3,667
  • 6
  • 20
  • 25
0

FILE is defined in stdio.h standard header file. As Johan mentioned the default library configuration in IAR IDE does not include full Dlib support. We can change to Full Dlib support under project options. Project options shall be opened with ALT + F7 Hotkey or project tab and then options. Check this Image. Project Options

venkatadp
  • 1
  • 1