title: C++ CLR error after adding function to .h file
body: <p>I'm not a C++ programmer but rather a "code editor", so I hereby apologize sincerely in advance for the question in general.</p>
  
  <p>For some broadcasting software I am editing a plug-in to give it interoperability between native C/++ and CLR (C#).</p>
  
  <p>The host software: OBS (Open Broadcaster Software) - obsproject.com</p>
  
  <p>The plug-in: CLR Host Plugin - github.com/kc5nra/CLRHostPlugin</p>
  
  <p>What I want to do is exposing functions from OBS to some CLR libraries, the total list of exposible functions can be found here: <a href="https://github.com/jp9000/OBS/blob/master/OBSApi/APIInterface.h#L198" rel="nofollow">https://github.com/jp9000/OBS/blob/master/OBSApi/APIInterface.h#L198</a></p>
  
  <p>Now the plug-in is a proxy between the languages and exposes some of the functionalities named above through API.h/cpp, <a href="https://github.com/kc5nra/CLRHostPlugin/blob/master/CLRHostInterop/API.h" rel="nofollow">https://github.com/kc5nra/CLRHostPlugin/blob/master/CLRHostInterop/API.h</a>. <strong><em>What I want to do is adding more functions to API.h to expose them to CLR libraries.</em></strong></p>
  
  <p>When I add a function in API.h, line 51, it'll give me linker errors.</p>
  
  <h2>The API.h change</h2>
  
  <pre><code>namespace CLROBS 
  {
  
      public ref class API
      {
      public:
          void AddSettingsPane(SettingsPane^ settingsPane);
          void AddImageSourceFactory(ImageSourceFactory^ imageSourceFactory);
          IntPtr API::GetMainWindowHandle();
          void Log(System::String^ format, ...array&lt;System::Object^&gt; ^arguments);
          System::String^ GetPluginDataPath();
          void SetChangedSettings(bool isChanged);
          int GetMaxFPS();
          void StartStopStream(); // Addition to the original.
      };
  };
  </code></pre>
  
  <h2>The API.cpp change</h2>
  
  <pre><code>#include "OBSApi.h"
  #include "API.h"
  #include "CLRHostApi.h"
  #include "OBSUtils.h"
  using namespace System::Runtime::InteropServices;
  // Default code......
  int API::GetMaxFPS()
  {
      return ::API-&gt;GetMaxFPS();
  }
  void API::StartStopStream()
  {
      OBSStartStopStream();
  }
  </code></pre>
  
  <h2>The Error</h2>
  
  <pre><code>error LNK2022: metadata operation failed (80131187) : Inconsistent method declarations in duplicated types (types: CLROBS.API; methods: StartStopStream): (0x0600006c). &lt;DIR&gt;\CLRHostPlugin\CLRHostInterop\API.obj  CLRHost.Interop
  error LNK2022: metadata operation failed (80131187) : Inconsistent method declarations in duplicated types (types: CLROBS.API; methods: StartStopStream): (0x0600006c). &lt;DIR&gt;\CLRHostPlugin\CLRHostInterop\AbstractPlugin.obj   CLRHost.Interop
  error LNK2022: metadata operation failed (801311D6) : Differing number of methods in duplicated types (CLROBS.API): (0x02000008).   &lt;DIR&gt;\CLRHostPlugin\CLRHostInterop\API.obj  CLRHost.Interop
  error LNK2022: metadata operation failed (801311D6) : Differing number of methods in duplicated types (CLROBS.API): (0x02000008).   &lt;DIR&gt;\CLRHostPlugin\CLRHostInterop\AbstractPlugin.obj   CLRHost.Interop
  </code></pre>
  
  <p>The in my eye's odd behaviour doesn't occur when using the plain code</p>
  
  <pre><code>namespace CLROBS 
  {
  
      public ref class API
      {
      public:
          void AddSettingsPane(SettingsPane^ settingsPane);
          void AddImageSourceFactory(ImageSourceFactory^ imageSourceFactory);
          IntPtr API::GetMainWindowHandle();
          void Log(System::String^ format, ...array&lt;System::Object^&gt; ^arguments);
          System::String^ GetPluginDataPath();
          void SetChangedSettings(bool isChanged);
          int GetMaxFPS();
          // - commented out - void StartStopStream(); // Addition to the original.
      };
  };
  </code></pre>
  
  <h2>Edit</h2>
  
  <p><em>Added API.cpp snippet</em></p>
  
  <p>Even when I comment out OBSStartStopStream(); on API.cpp the error still exist.</p>
  
  <h3>/Edit</h3>
  
  <p>Please assist.</p>
  
  <p>Regards,</p>
  
  <p>MusicDemon</p>