Change your z.c to
#include "a.h"
#include "b.h"
#include "global.h"
int count; /* Definition here */
int main() {
count = 0;
functAb();
functBa();
return 0;
}
From global.h, all your files inherit the declaration of variable count but the definition is missing from all files.
You must add the definition to one of the file as int count = some_value;