You do not include the implementation (the source code which implements the function), only the function or variable declaration. So no #include "solucion1.cpp".
In one .cpp file only. The extern keyword makes a simple declaration “the exists a variable of this type and name somewhere”. It doesn’t create the variable or define its value. In fact, if you declare the existence of a variable which is never defined, you get an undefined reference error.
See e.g. variable declaration - When to use extern in C++ - Stack Overflow