title: SWIG c++ to C# error unable to find entry point SWIGRegisterExceptionCallbacks_xxxx
body: <p>So I got this simple C++ code that I try to wrap using swig 3.0.2 to generate the C# equivalent. </p>
  
  <p>So here is the c++ code</p>
  
  <p>myclass.hpp</p>
  
  <pre><code>#ifndef __MYCLASS__
  #define __MYCLASS__
  
  class myclass {
  public:
      int add(int b, int c);
  };
  
  #endif
  </code></pre>
  
  <p>myclass.cpp</p>
  
  <pre><code>#include "myclass.hpp"
  
  int myclass::add(int a, int b) {
      return a+b;
  }
  </code></pre>
  
  <p>myclass.i</p>
  
  <pre><code>%module mymodule
  
  %{
  #include "myclass.hpp"
  %}
  
  %include "myclass.hpp"
  </code></pre>
  
  <p>So here is the swig command</p>
  
  <pre><code>swig -csharp -c++ -outdir csharp myclass.i
  </code></pre>
  
  <p>And here is the compilation command using MinGW </p>
  
  <pre><code>g++ -shared -I./ myclass_wrap.cxx myclass.cpp -o mymodule.dll
  </code></pre>
  
  <p>So then I try to use the generate code by swig in a console application and I get the following error:</p>
  
  <blockquote>
    <p>Unable to find an entry point named
    'SWIGRegisterExceptionCallbacks_mymodule' in DLL 'mymodule'.</p>
  </blockquote>
  
  <p>So it is loading the mymodule.dll correctly but can't find the SWIGRegisterExceptionCallbacks_mymodule which seems weird ... it is present in the myclass_wrap.cxx with what seems to be the correct export keyword <code>__declspec(dllexport)</code></p>
  
  <p>Thanks for the help, </p>
  
  <p>Cheers</p>