I'm attempting to make a custom header in C for user input. Whenever I try to use it, it throws the error:
"Undefined Reference to (FUNCTION_NAME)"
It's in the same folder as all the other header files and vscode doesn't have a problem finding the header file. Both the .h and .c are in the same folder.
Here is the code in the header, c file, and program I'm using:
SGGINPUT.h
#ifndef SGGINPUT
#define SGGINPUT
#include <stdio.h>
char SGGchar();
#endif
SGGINPUT.c
#include <stdio.h>
#include "SGGINPUT.h"
char SGGchar() {
char c;
printf("Enter Char: ");
scanf("%c",&c);
printf("\n");
return c;
}
test.c
#include <stdio.h>
#include "SGGINPUT.h"
int main() {
char c = SGGchar();
printf("%c",c);
}