I am attempting to create header files for my functions but it doesn't work for me. Can someone tell me what I am doing wrong? Below is what I put in each file
hello.h
#include <stdio.h>
void hello(); /* prototype of function */
hello.c
void hello()
{
printf("Hello World!\n"
;
}
test.c
#include "hello.h"
int main(int argc,char *argv[])
{
hello();
return 0;
}
running gcc test.c I got the following error
test.c:4: undefined reference to `hello'
hello.h
#include <stdio.h>
void hello(); /* prototype of function */
hello.c
void hello()
{
printf("Hello World!\n"
}
test.c
#include "hello.h"
int main(int argc,char *argv[])
{
hello();
return 0;
}
running gcc test.c I got the following error
test.c:4: undefined reference to `hello'