I have a program named "main.c" containing the main() that calls a function whose definition is available in other source file named "nim.c". I made a header file named "nim.h" that contains the prototype of the required method. This header file "nim.h" is already included it in my "main.c". I am putting up all the files that are part of this program.
//main.c
#include <stdio.h>
#include "nim.h"
int main()
{
print();
return 0;
}
//nim.h
#include<stdio.h>
void print();
//nim.c
#include<stdio.h>
void print()
{
printf("hello !!");
}
print(via the include) but the linker won't be able to find an implementation of it.gcc main.c nim.o, or compile them together,gcc main.c nim.c.