title: swig error: Extraneous #endif
body: <p>When I executed the swig command on my .i file, I am getting an error on an include file.</p>
  
  <p>The error says:</p>
  
  <pre><code>../include/example.h: Error: Extraneous #endif.
  </code></pre>
  
  <p>The contents of the example.h file is as below:</p>
  
  <pre><code>#ifndef EXAMPLE_H
  #define EXAMPLE_H
  
  namespace my_example {
  
  class BaseExample {
  public:
      virtual ~BaseExample() {}
  };
  
  }
  
  #endif /* EXAMPLE_H */
  </code></pre>
  
  <p>In the above code, the #endif correctly matches with #ifndef.
  So, why is swig reporting "Extraneous #endif." ?</p>