Please see my first attempt at answering this . I neglected to tell the whole story before in an attempt to simplify things. Turns out my example works! Sorry.
The w
Just declare the main outside the MyNamespace
and specify global namespace ::
in friend statement
//in header file of ProcessManager
//your pf.h
int main(int argc, char** argv);
namespace MyNamespace
{
class ProcessManager
{
public:
friend int ::main(int argc, char** argv);
private:
void test();
};
};