$ cat a.h extern int f() { return 5; } $ cat 1.c #include "a.h" int main() { void g(); g(); return 0; } $ cat 2.c #include "a.h" #include void g() { printf("%d\n", f()); } $ gcc 1.c 2.c /tmp/ccrAqQEC.o: In function `f': 2.c:(.text+0x0): multiple definition of `f' /tmp/ccQGjSBs.o:1.c:(.text+0x0): first defined here collect2: ld returned 1 exit status