Keil Logo

C51: Compiler Is Unable to Find Include Files

Information in this article applies to:

  • C51 Version 5.10
  • C51 Version 5.20
  • C51 Version 5.50


When I try to compile my C file it gives an error saying it is unable to open the header file that I am specifying. Using Windows Explorer, I can see the header file in my C51\INC folder. What is wrong?


Either the wrong path has been specified or your Autoexec.bat file has been altered, such that the environment variables pointing to the INC and LIB folders are ineffective.


Choose 'Environment Pathspecs' from the Options menu and either check the option to automatically determine the paths, or verify that the paths entered are correct.

Ensure that lines similar to the following are in your Autoexec.bat file:

set c51lib=c:\c51\lib
set c51inc=c:\c51\inc

Reboot your machine after making any changes to the Autoexec.bat file.

If neither of these possibilities work, then re-install your tools.


Be sure to use lowercase directory paths in Windows 95 and later. Using uppercase path names may confuse C51 Version 5.10 and earlier.

Last Reviewed: Tuesday, February 23, 2021

Did this article provide the answer you needed?
Not Sure
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.