title: Resolving a " cannot define member function ... within .."
body: <p>I have been struggling with this issue for a while and I would like to know a systematic way of figuring out why I might be getting this error. Apparently I have multiple components in my solution. I am getting this error when I attempt to build one of my components.</p>
  
  <pre><code>error: cannot define member function 'ImageFramework::ACE_Main::run_i' within 'ImageFramework'
  
  
  In file included from C:\mingw64\required\ACE\ACE_wrappers/ace/config-all.h:89:0,
                   from C:\windows-libs\corba\ACE_wrappers\TAO\orbsvcs/orbsvcs/CosNamingC.h:37,
                   from C:\Users\UserAdmin\TreeShell\MainProcess\SourceCode\ExternalCommunication\CORBA/TCorbaClient.h:12,
                   from C:\Users\UserAdmin\TreeShell\MainProcess\SourceCode\ExternalCommunication/SystemCommunicator.h:23,
                   from C:\Users\UserAdmin\TreeShell\MainProcess\SourceCode\ApplicationManager\ApplMngExternalComm.h:18,
                   from C:\Users\UserAdmin\TreeShell\MainProcess\SourceCode\ApplicationManager\ApplMngMessageHandler.h:15,
                   from C:\Users\UserAdmin\TreeShell\MainProcess\SourceCode\ApplicationManager\ApplMngMessageHandler.cpp:15:
  C:\mingw64\required\ACE\ACE_wrappers/ace/OS_main.h:218:51: error: cannot define member function 'ImageFramework::ACE_Main::run_i' within 'ImageFramework'
   inline int ACE_Main::run_i (int argc, char *argv[])  \
  </code></pre>
  
  <p>A little background the component uses an external library called ace and the error lands me in an ace source file (which i am hesitant to touch as its not a part of my project). Which is something like this</p>
  
  <pre><code>#       define main \
  ace_main_i (int, char *[]); \
  ACE_BEGIN_VERSIONED_NAMESPACE_DECL \
  ACE_Export int ace_os_main_i (ACE_Main_Base&amp;, int, char *[]); \
  class ACE_Main : public ACE_Main_Base {int run_i (int, char *[]);}; \
  inline int ACE_Main::run_i (int argc, char *argv[])  \
  { \
    return ace_main_i (argc, argv); \
  } \
  ACE_END_VERSIONED_NAMESPACE_DECL \
  int \
  ACE_MAIN (int argc, char *argv[]) /* user's entry point, e.g., wmain */ \
  { \
    ACE_Main m; \
    return m.run (argc, argv); /*ace_os_main_i (m, argc, argv);   what the user calls "main" */ \
  } \
  
  int \
  ace_main_i
  
  #     endif /* ACE_WIN32 &amp;&amp; ACE_USES_WCHAR */
  
  #   else /* ACE_HAS_WINCE */
  </code></pre>
  
  <p>Anyways here is what I have tried for the above mentioned  error message error so</p>
  
  <pre><code> error: cannot define member function 'ImageFramework::ACE_Main::run_i' within 'ImageFramework'
  </code></pre>
  
  <p>I have looked through the <code>ImagFramework</code>  class source <code>.h</code> and <code>.cpp</code> which has multiple include files. (Furthermore this class acts as a base class to many other classes) to see if an ace library header was included however I could not find any. I would appreciate suggestions on what might be a systematic approach on finding out what might be causing this issue . I might even be wrong interpreting this message. My understanding of this message is that possibly a method in the <code>imageframework</code> class or a method in its base class might be triggering the above part of the code. Please correct me if I am wrong ? Any suggestions ideas on this issue would be appreciated. Are there any other reasons why i might be getting this ?</p>