title: mupdf - invalid use of 'static' in linkage specification
body: <p>I'm trying an experiment with <a href="http://code.google.com/p/waf/" rel="nofollow">waf</a> (the build system) on <a href="http://www.mupdf.com/" rel="nofollow">mupdf</a>.</p>
  
  <p>I've encountered a compiler error when compiling <a href="http://code.google.com/p/sumatrapdf/source/browse/trunk/mupdf/source/fitz/gdiplus-device.cpp" rel="nofollow">mupdf\fitz\dev_gdiplus.cpp</a>.</p>
  
  <pre><code>..\..\..\mupdf\fitz\dev_gdiplus.cpp:1170:12: error: invalid use of 'static' in linkage specification
  
   extern "C" static void
  </code></pre>
  
  <p>The offending code (this is one instance; there are many):</p>
  
  <pre><code>extern "C" static void
  fz_gdiplus_fill_path(fz_device *dev, fz_path *path, int evenodd, const fz_matrix *ctm,
      fz_colorspace *colorspace, float *color, float alpha)
  {
      GraphicsPath *gpath = gdiplus_get_path(path, ctm, false, evenodd);
      Brush *brush = gdiplus_get_brush(dev, colorspace, color, alpha);
  
      ((userData *)dev-&gt;user)-&gt;started = true;
      ((userData *)dev-&gt;user)-&gt;graphics-&gt;FillPath(brush, gpath);
  
      delete brush;
      delete gpath;
  }
  </code></pre>
  
  <p>This was the compiler call:</p>
  
  <pre><code>['C:\\MinGW64\\mingw64\\bin\\g++.exe', '-fpermissive', '-IC:\\Users\\Administrator\\Downloads\\SumatraPDF-2.3.2-source\\sumatrapdf-2.3.2\\build\\temp\\debug\\mupdf\\fitz', '-IC:\\Users\\Administrator\\Downloads\\SumatraPDF-2.3.2-source\\sumatrapdf-2.3.2\\mupdf\\fitz', '-IC:\\Users\\Administrator\\Downloads\\SumatraPDF-2.3.2-source\\sumatrapdf-2.3.2\\build\\temp\\debug\\mupdf', '-IC:\\Users\\Administrator\\Downloads\\SumatraPDF-2.3.2-source\\sumatrapdf-2.3.2\\mupdf', '-IC:\\Users\\Administrator\\Downloads\\SumatraPDF-2.3.2-source\\sumatrapdf-2.3.2\\build\\temp\\debug\\mupdf\\pdf', '-IC:\\Users\\Administrator\\Downloads\\SumatraPDF-2.3.2-source\\sumatrapdf-2.3.2\\mupdf\\pdf', '-IC:\\Users\\Administrator\\Downloads\\SumatraPDF-2.3.2-source\\sumatrapdf-2.3.2\\build\\temp\\debug\\mupdf\\xps', '-IC:\\Users\\Administrator\\Downloads\\SumatraPDF-2.3.2-source\\sumatrapdf-2.3.2\\mupdf\\xps', '-IC:\\Users\\Administrator\\Downloads\\SumatraPDF-2.3.2-source\\sumatrapdf-2.3.2\\build\\temp\\debug\\ext\\freetype2\\include', '-IC:\\Users\\Administrator\\Downloads\\SumatraPDF-2.3.2-source\\sumatrapdf-2.3.2\\ext\\freetype2\\include', '-IC:\\Users\\Administrator\\Downloads\\SumatraPDF-2.3.2-source\\sumatrapdf-2.3.2\\build\\temp\\debug\\ext\\jbig2dec', '-IC:\\Users\\Administrator\\Downloads\\SumatraPDF-2.3.2-source\\sumatrapdf-2.3.2\\ext\\jbig2dec', '-IC:\\Users\\Administrator\\Downloads\\SumatraPDF-2.3.2-source\\sumatrapdf-2.3.2\\build\\temp\\debug\\ext\\libjpeg-turbo', '-IC:\\Users\\Administrator\\Downloads\\SumatraPDF-2.3.2-source\\sumatrapdf-2.3.2\\ext\\libjpeg-turbo', '-IC:\\Users\\Administrator\\Downloads\\SumatraPDF-2.3.2-source\\sumatrapdf-2.3.2\\build\\temp\\debug\\ext\\openjpeg', '-IC:\\Users\\Administrator\\Downloads\\SumatraPDF-2.3.2-source\\sumatrapdf-2.3.2\\ext\\openjpeg', '-DWAF=1', '-DVERSION="0.1"', '-DINLINE_MACRO=1', '-DHAVE_STDINT_H=1', '-DHAVE_STRING_H=1', '-DHAVE_STDIO_H=1', '-DDEBUG=1', '..\\..\\..\\mupdf\\fitz\\dev_gdiplus.cpp', '-c', '-o', 'mupdf\\fitz\\dev_gdiplus.cpp.1.o']
  </code></pre>
  
  <p>I suspect this is something to do with gcc, rather than the code. 
  What's wrong with the code? What switches/flags need to be given to gcc to resolve the issue?</p>
  
  <p>I'm using gcc (rev3, Built by MinGW-builds project) 4.8.1, on Windows 7 64bit.</p>
  
  <p>Disclaimer: I don't understand c++.</p>