C - Undefined reference to function error with linked files
问题 I started implementing a large program. But I ran into a massive issue. So here is very simplified code of my program. I have a separate .c file for my functions which is normal.c the main program is main.c and I have linked those two with cal.h header file. main.c #include <stdio.h> #include "cal.h" void main() { int num1, num2, ans; num1=5; num2=5; ans=add(num1, num2); printf("%d" ,ans); } normal.c #include "cal.h" int add(int num1, int num2) { return num1+num2; } cal.h #ifndef CAL_H