title: c++ Meyers singleton undefined reference
body: <p>I have the following code that implements a basic Meyers singletone:</p>
  
  <pre><code>#ifndef _cConfigFile_HH
  #define _cConfigFile_HH
  
  class cConfigFile {
  public:
    static cConfigFile&amp; getInstance() {
      static cConfigFile instance;
      return instance;
    };
  private:
    cConfigFile();
  };
  
  #endif
  </code></pre>
  
  <p>My compiler doesn't allow me to compile this, giving the following error:</p>
  
  <pre><code>/include/cConfigFile.hh:7: undefined reference to `cConfigFile::cConfigFile()'
  </code></pre>
  
  <p>From the error I understand that I need to declare "instance" in a .cpp file, but am unable to declare cConfigFile::instance because the compiler says: </p>
  
  <blockquote>
    <p>‘cConfigFile cConfigFile::instance’ is not a static</p>
  </blockquote>
  
  <p>What am I doing wrong?? I'm lost here..</p>