warning C318: can't open file 'sample delay.h'

#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.

Parents
  • Several possible.

    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.
    ...

    But the big question here is why you ask for help without informing us what steps you have taken yourself to figure out why the compiler can't locate that file. It isn't like the message is unclear.

    By the way - think twice about using spaces in source file names. It tends to produce lots of grief since not all build environments will properly use break characters or quotes when executing command-line tools. And space is used as parameter separator...

Reply
  • Several possible.

    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.
    ...

    But the big question here is why you ask for help without informing us what steps you have taken yourself to figure out why the compiler can't locate that file. It isn't like the message is unclear.

    By the way - think twice about using spaces in source file names. It tends to produce lots of grief since not all build environments will properly use break characters or quotes when executing command-line tools. And space is used as parameter separator...

Children
More questions in this forum