Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

I am using IAR embedded workbench software for ARM CORTEX M7 controller. I have already included stdio.h library and it have fopen function like this enter image description here

but when i am declaring my file pointer like this

FILE *fpointer;

Its giving me these two errors.

Please share your experience how can i fix it?

Please create a minimal reproducible example of your code to show us. And copy-paste the errors from that code, as text, in full and complete into the question. Some programmer dude Jan 14, 2019 at 10:19 I'd check the header file for #if and #ifdef to see if there are some conditional rules that mean you aren't getting the declaration. You could try adding an #error line just above the FILE declaration in stdio.h too to see if you hit it, and/or at the top of the file to verify this is the right one that's getting included. Rup Jan 14, 2019 at 10:25 Probably you have to tell the compiler to use full ISO C libraries or such. Since stdio.h isn't usually used for embedded systems - the compiler could be in "freestanding mode" by default, in which case it doesn't have to provide PC programming libraries. Lundin Jan 14, 2019 at 10:30

File I/O is not present in the default library. To enable it you need to tell the compiler to use full libraries. This is done by opening the project options and choosing "Full" in the "Library Options" tab if you are using the IDE or by using the command line option --dlib_config full if you are using the command line compiler.

In addition, unless you are ok with using semihosting for input and output, you need to implement the low level I/O interface for your target.

Also, it's likely that low level I/O functions like __open and __read have to be implemented by the user. user694733 Jan 14, 2019 at 11:33

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question . Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers .