School of Physics, Mathematics, and Computing 
Not logged in (login)
help2002

This forum is provided to promote discussion amongst students enrolled in CITS2002 Systems Programming.

Please consider offering answers and suggestions to help other students! And if you fix a problem by following a suggestion here, it would be great if other interested students could see a short "Great, fixed it!" followup message.

How do I ask a good question?
 

Final examination information
Options:
RSS cloud
Jump to:

#include "first_day_of_month.c" // file not found....

3 of 951 articles shown, currently no other people reading this forum.
photo
From: ANONYMOUS
Date: Tue 10th Aug 2021, 11:02am
Actions: 
Login-to-reply

The program could not find the file...

mycal.c:10:10: fatal error: './first_day_of_month.c' file not found
#include "./first_day_of_month.c"

it's all stored in the same file.

Many thanks.

#include "first_day_of_month.c" // file not found....

photo
From: Christopher M.
Date: Tue 10th Aug 2021, 11:17am
Actions: 
Login-to-reply

ANONYMOUS wrote:

> The program could not find the file...
> 
> mycal.c:10:10: fatal error: './first_day_of_month.c' file not found
> #include "./first_day_of_month.c"

The C compiler is stating that the file  first_day_of_month.c  is not found in the same 
directory as your main C file.  You've downloaded it, and copied there?

 
> it's all stored in the same file.

Unsure what this means,  but if you've copied the contents of  first_day_of_month.c. 
into your main C file, then you don't need the #include ...  line at all.

#include "first_day_of_month.c" // file not found....

photo
From: Amitava D.
Date: Wed 11th Aug 2021, 8:25am
Actions: 
Login-to-reply

ANONYMOUS wrote:

> The program could not find the file...
> 
> mycal.c:10:10: fatal error: './first_day_of_month.c' file not found
> #include "./first_day_of_month.c"
> 
> it's all stored in the same file.
> 
> Many thanks.

Try the ls command to check whether the file is in the current directory, the name should be listed. But as Chris has written, there is no need to include the file if you already have the code in your source file. This is an error message from the preprocessor, it replaces the content of the file mentioned in the #include statement. It gives up when it cannot find the file. 
This Page


Program written by: [email protected]
Feedback welcome
Last modified:  4:54pm Oct 24 2021