I'm trying to link my c files and header files in compilation, but get the following error:
fatal error: header1.h: No such file or directory #include <header1.h>
The problem is, I have included the header file using #include <header1.h>
in each c file, and compiled using the command gcc header1.h file1.c file2.c main.c -Wall -std=c99
But still gives me the error in every c file. I've included the top of my code from each file below.
header1.h:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef struct microtreat{
int id;
char user[51];
char text[141];
struct microtreat*next;
}treat;
main.c:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <header1.h>
file 1:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <header1.h>
file 2:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <header1.h>
How do I fix this error? Thanks