oh, now I understand: you tell the compiler with externint t; that in another file int t exists, but it doesn't. You should add int t; to my2.cpp or use.cpp.
Sorry I can't understand! I don't have int t in another file, and in addition if I declare an externint with another name (say, externint foo) the problem still exists and only the name of 't' will replace with 'foo' in error messages.
I think whatever problem there is it's about externint t
I declared the externint t in my1.h and defined it in my2.cpp and used in use.cpp. It should works easily but doesn't!
I think you want to pass the value of t on the print_t() function. In this case t must contained on print_t() arguments as:
1 2 3
void print_t(int t){
cout<<t<<'\n';
}
In this case not use external for t. This is common variable passing by value.
External used for precompiled libraries to .obj. #include works like included code has writen in the include point.