I am having some trouble compiling a few files using headers. Here is a breakdown of my code:
file1.c
#include "header.h"
int main() {
func1();
return 0;
}
file2.c
#include "header.h"
void func1() {
... function implementation ...
}
header.h
void func1();
The error I am getting is:
In function
'main'
:
undefined reference to'func1'
Note: I am just using a simple breakdown of how my 3 files are set up. I need to get this to work with the 3 files. I am setting/including everything properly? I need to use this set up, but I am just unsure how file.c gets reference to the actually implementation of func1()
.