Global variables defined in headers will cause duplicate symbols linkage error when this header is included in multiple source files. We should declare it by extern in header and define it in c source file.
http://stackoverflow.com/questions/1433204/how-do-i-use-extern-to-share-variables-between-source-files-in-c