C++ error: redefinition of class : <p><strong>Note:</strong> I have searched thoroughly on SO and the solutions posted for other's with similar questions are not working for me here.</p>

<p>I am writing my own custom 'string-like' class in C++, and am encoutering the following errors when compiling:</p>

<blockquote>
  <p>./PyString.h:8:11: error: out-of-line declaration of 'PyString' does
  not match any declaration in 'PyString' PyString::PyString (char*);
            ^</p>
  
  <p>./PyString.h:9:11: error: definition of implicitly declared destructor PyString::~PyString (void);</p>
  
  <p>pystring.cpp:4:7: error: redefinition of 'PyString' class PyString {</p>
</blockquote>

<p>As for the first and second errors, moving around the destructor into the class definition itself in the <code>cpp</code> file did not work.</p>

<p>As for the third error, I can't seem to fix it - I'm not redefining the class!</p>

<p>Here is <code>pystring.h</code>:</p>

<pre><code>#ifndef PYSTRING_INCLUDED
#define PYSTRING_INCLUDED

class PyString {
    char* string;
};

PyString::PyString (char*);
PyString::~PyString (void);

#endif
</code></pre>

<p>Here is <code>pystring.cpp</code>:</p>

<pre><code>#include "PyString.h"
#define NULL 0

class PyString {
    char* string = NULL;
  public:
    PyString(char inString) {
      string = new char[inString];
    };

    ~PyString(void) {
      delete string;
    };
};
</code></pre>

<p>For reference, here is the compile output as a screenshot:
<a href="https://i.stack.imgur.com/hPrq8.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hPrq8.png" alt="Compiler output screenshot"></a></p>

<p>Any help is greatly appreciated.</p>
