title: C++ namespace not declared but it is?
body: <p>I'm having a compile time problem. New to C++ so I'm sure it's simple. I am gettign the current error.</p>
  
  <pre><code>diarydb.cpp: In function ‘bool editdate(int, mysqlpp::Connection&amp;)’: diarydb.cpp:413:
  error: ‘format_tests’ has not been declared
  </code></pre>
  
  <p>but diardby.cpp I have declared format_tests here</p>
  
  <pre><code>namespace format_tests {
    bool testdateformat(string &amp;date);
    bool tesettimeformat(string &amp;time);
    bool lengthcheck(string &amp;in,int length);
  
  }
  </code></pre>
  
  <p>with</p>
  
  <pre><code>bool format_tests::testdateformat(string &amp;date){
    // tests format of dat input for MYSQL form at of YYYY-MM-DD
    // Need to tweak regex to restrict 0 &lt; MM &lt; 12 and 0 &lt; DD &lt;31.
  
    const boost::regex e("\\d{4}\\x2D\\d{2}\\x2D\\d{2}");
    return boost::regex_match(date,e);
  }
  </code></pre>
  
  <p>the compiler compler of the call here.</p>
  
  <pre><code>  bool dbsetget::editdate(int e_id,mysqlpp::Connection &amp;con){
  
          char evdate[11];
  
      cout &lt;&lt; "Input start time" &lt;&lt; endl;
      cin.getline(evdate,11,'\n'); // restrict legth of input with getline.lenght of input
  
      string date = evdate;
  
      if (format_tests::testdateformat(date)){
      mysqlpp::Query query = con.query();
      query &lt;&lt;"UPDATE main SET date="&lt;&lt; quote_only &lt;&lt; date &lt;&lt;"WHERE d_Id ="&lt;&lt; e_id;
  
      return query.exec();
      }
      else
      {
        cerr &lt;&lt; "Date not in correct format. YYYY-MM-DD ";
        return false;
      };
    }
  </code></pre>
  
  <p>I don't understand what the problem is? I have declared format_tests namespace Can anyone please guide me?</p>
  
  <p>I'm sure there are plenty of to mistakes in here too but this one has got me pretty confused.</p>