Why cant I access the variable value defined in the file.cpp file. Assuming it is linked with main. Tricky part is that the variable value is included indirectly. Main function includes header1.h which in return includes file.h which has variable value as extern. Can extern be propagated in chain of headers like this
1) file.h
extern int value;
2)file.cpp
#include "file.h"
int value = 25;
3) header1.h
#include "file.h"
const int const_value = 100;
4) main.cpp
#include "header1.h"
int main(char *argv[], int args) {
int result = value*10;
return result;
}