I cannot acces the method from File1 in File2
Indeed. One translation unit doesn't know about declarations in other translation units. Since you call the function in File2.cpp, the function must be declared in that translation unit.
Solution to that problem: Declare the function in the file where you use the declaration:
// File2.cpp
namespace n1
{
namespace
{
bool method(); // see next paragraph
}
}
Now, we have another problem. Functions in anonymous namespaces are implicitly static. And static functions must be defined in all translation units where they are ODR used. So, a declaration is not sufficient after all; we need the definition:
// File2.cpp
namespace n1
{
namespace
{
bool method()
{
} // see addendum
}
}
Now, since the function in File1.cpp is never called and the file contains nothing else, we can actually remove that file.
P.S. The function definition has undefined behaviour because it doesn't exist the function by returning a value (nor by throwing) despite the return type being non-void.