error 'extern' and later 'static'
<p>If i declare a function  in a file named ppmformat.h </p>

<pre><code>//file ppmformat.h
namespace imaging
{
Image * ReadPPM(const char * filename);
} //namespace imaging
</code></pre>

<p>... and define it in ppmformat.cpp</p>

<pre><code>static imaging::Image * imaging::ReadPPM(const char *filename)
{
 ....
}
</code></pre>

<p>I get the following error:</p>

<blockquote>
  <p>'imaging::Image* imaging::ReadPPM(const char*)' was declared 'extern' and later 'static' [-fpermissive]</p>
</blockquote>

<pre><code>    //ppmformat.h
    #ifndef _PPM
    #define _PPM

    #include "Image.h"
    namespace imaging
    {
    /*! Reads a PPM image file and returns a pointer to a newly allocated                  Image object containing the image.
    *
    *   \param filename is the null-terminated string of the name of the  file to open.
    *
    *  \return a pointer to a new Image object, if the read operation was successful, nullptr otherwise.
    */
    Image * ReadPPM(const char * filename);
    } //namespace imaging

    #endif

   //ppmformat.cpp
   #include &lt;iostream&gt;
   #include&lt;string.h&gt;
   #include&lt;stdio.h&gt;
   #include&lt;stdlib.h&gt;
   #include &lt;string&gt;
   #include &lt;fstream&gt;
   #include "ppmformat.h"

   using namespace std;

   imaging::Image * imaging::ReadPPM(const char *filename)
   {
   ......
   }

   //Image.h

   #ifndef _IMAGE
   #define _IMAGE

   #include "Color.h"
   #include &lt;iostream&gt;

   namespace imaging
   {
    class Image
    {
    ....
    }
   }

  //Image.cpp
  #include &lt;iostream&gt;
  #include "Color.h"
  #include "Image.h"
  ....
  //end of Image.cpp

  //Color.h
  #ifndef _COLOR
  #define _COLOR
  namespace imaging
  { 
    Class Color
    {
    ....
    }
  }
</code></pre>