im having trouble understanding how to get the code in my src folder as shown below to run the header file in the include folder.
Include contains a functions.h file, and src contains a functions.c file as well as my main.c
The main contains a "#include "functions.h" ", and a reference to a function declared in function.h and function.c
When i'm in the main directory, to compile everything, I run the following:
gcc -Wall -Werror -Iinclude src/main.c
/tmp/ccHmaM4g.o: In function `main':
main.c:(.text+0x78): undefined reference to `sum'
collect2: error: ld returned 1 exit status
You need to link
function.c into your binary:
gcc -Wall -Werror -Iinclude src/main.c src/function.c