This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

extern variable declaration not interchangeable to another c file?

Hi,

At my main. c file, I have these below variable declarations.

/*
* GLOBAL VARIABLES -- Start
*/
_u32 g_Status = 0;
_u32 g_PingPacketsRecv = 0;
_u32 g_GatewayIP = 0;
_u32 ui32SysClock;

At my cloud_demo.c I declare g_Status and ui32SysClock as "extern" to make these variables visible to all c files.

extern unsigned long ui32SysClock;
extern unsigned long g_Status;

If I declare these variables as extern at main c file instead. the g_Status variable cause this error bellow. But the ui32SysClock variable does not cause any error. Why is that? This error is sort of weird. 

Description Resource Path Location Type
#10056 symbol "g_Status" redefined: first defined in "./cloud_demo.obj"; redefined in "./main.obj" wlan_station_exosite_write_read C/C++ Problem

- kel