We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
#include <reg51.h> //#include "sample delay.h" void MSDelay(unsigned int); void main(void) { while (1) //repeat forever { P1=0x55; MSDelay(250); P1=0xAA; MSDelay(250); } }
#include "sample delay.h" void MSDelay(unsigned int itime) { unsigned int i,j; for (i=0;i<itime;i++) for (j=0;j<1275;j++); }
while do build it displays a warning message in the build window as below sample delay.c(1): warning C318: can't open file 'sample delay.h' please help me in finding out the causes for this warning.
1) You don't have any file with that name. 2) You get into troubles because the file name contains a space. 3) You do have such a file, but not in a path that the compiler is configured to scan for include files. 4) You do have such a file but do not have the required access rights to open it.
thanks for your reply the program works well in simulation,it generates expected output.but every time while compiling and building it shows warning message
compiling sample4.c... compiling msdelay.c... msdelay.c(1): warning C318: can't open file 'msdelay.h' linking... Program Size: data=9.0 xdata=0 code=68 "sample4" - 0 Error(s), 1 Warning(s).
1)it is clear file is there in that name 2)i have removed space though it shows warning message(not error message). 3)----------------------------- 4)access rights are provided(using property, i have checked it)
3)i used to set the path in the following manner is it correct? project workspace>source group1>right click>add files to group 'source group'>msdelay.c