fork download
  1. //---------header.hpp------------------
  2. #include <iostream>
  3.  
  4. namespace A { static int V; }
  5.  
  6. inline void check_address()
  7. {
  8. std::cout << &A::V << std::endl;
  9. }
  10.  
  11. //---------source1.cpp------------------
  12. #include "header.hpp"
  13. int main()
  14. {
  15. check_address();
  16.  
  17. extern void test();
  18. test();
  19. }
  20.  
  21. //---------source2.cpp------------------
  22. #include "header.hpp"
  23. void test()
  24. {
  25. check_address();
  26. }
  27.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:12:22: fatal error: header.hpp: No such file or directory
 #include "header.hpp"
                      ^
compilation terminated.
stdout
Standard output is empty