Hey guys,
Im new to c and im having trouble calling a function from a file "that.c" and im making the call from a file "this.c" and they both have "common.h" in common
i dont know what im doing wrong
that.c
Code:
#import "common.h"
#import <stdio.h>
void sayHello(){
printf("hello");
}
this.c
Code:
#import "common.h"
#import <stdio.h>
int main(void){
sayHello();
}
and finally
common.h
Code:
#ifndef HEADER_FILE
#define HEADER_FILE
// prototype
void sayHello();
#endif;
and the error im getting is
Code:
$gcc this.c
/tmp/ccWzgg44.o: In function `main':
this.c:(.text+0x12): undefined reference to `sayHello'
collect2: ld returned 1 exit status
please help