The component complains because there will be several definitions xafter combining all the object files to create an executable file. You have two different source files, including the same header file, and this header file defines a variable xthat has a value of 10, so you get two definitions x(one in 1.c and the other in 2.c).
, (, globals.h):
#ifndef GLOBALS_H
#define GLOBALS_H
extern int x;
#endif
:
#include "globals.h"
int x = 10;