c++ cross related singleton. how can i use function of each other without friends? : <p>I've got helped a lot in here.</p>

<p>this is my first time to ask a question.
ahead, sorry for my bad English.</p>

<p>I made two classes which is singleton for a project.
and its class needs to use other class's functions.</p>

<p>One is app class managing overall app's function
and the other one is menu class, which I am trying to add go back function by using stack.</p>

<p>app needs menu, and menu needs app to execute app function when you select a menu numbers.</p>

<p>but error shows up and I have no idea how should i correct it ;_;
thank you for your help</p>

<p>this is app.h &amp; app.cpp file</p>

<pre><code>   #include &lt;iostream&gt;
    #include "Menu.h"
    using namespace std;

    class App
    {
        static App app;
        App();
    public:
        static App* GetAppInstance();
        Menu* getMenuInstance();
    };
</code></pre>

<hr>

<pre><code>   #include "App.h"
    #include &lt;iostream&gt;
    using namespace std;

    App App::app;
    App::App()
    {
        cout &lt;&lt; "App" &lt;&lt; endl;
    }

    App * App::GetAppInstance()
    {
        return &amp;app;
    }
    Menu* App::getMenuInstance()
    {
        return Menu::getMenuInstance();
    }
</code></pre>

<p>and this is Menu.cpp and Menu. h file</p>

<pre><code>#include &lt;iostream&gt;
using namespace std;
class App;
class Menu
{
    static Menu menu;
    Menu();
public:
    static Menu* getMenuInstance();
    App* getAppInstance();
};
</code></pre>

<hr>

<pre><code>#include "Menu.h"
#include &lt;iostream&gt;
using namespace std;
class App;
Menu::Menu()
{
    cout &lt;&lt; "메뉴" &lt;&lt; endl;
}

Menu * Menu::getMenuInstance()
{
return &amp;menu;
}

App* Menu::getAppInstance()
{
    return App::GetAppInstance();
}

Menu Menu::menu
</code></pre>
