Q: make extern variable globally visible across all projects in sln file project_1.vcproj contains:
header_1.h has "extern int flag;" is declared.
source_1.c has "int flag = 0" initialized
project_2.vcproj contains:
source_2.c has a function which modifies the value of flag.
#include "header_1.h"
 void setFlag() {
    flag = 1;
}

When I try to compile this I get link errors:
error LNK2001: unresolved external symbol "int flag"
What I am trying to achieve is I want the value of flag to be visible globally. 
Because after the flag is set to 1, source_1.c uses this information do other things. 
Please let me know how to achieve me. Thanks.

A: You have to #include "header_1.h" at the top of source_2.c.
Also make sure source_1.c is included in project_2.

A: Project_2 must include header_1.h or Project_2 must declare extern int flag. Either way, you will need to link Project_2 against the actual storage location of int flag. Otherwise, project_2 won't manipulate the value of int flag in located in Project_1.

A: extract int flag = 0 into separate .c file and add that source file into both projects
