编译mupdf\fitz\dev_gdiplus.cpp时遇到编译器错误。
..\..\..\mupdf\fitz\dev_gdiplus.cpp:1170:12: error: invalid use of 'static' in linkage specification
extern "C" static void
有问题的代码(这是一个实例;有很多):
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->user)->started = true;
((userData *)dev->user)->graphics->FillPath(brush, gpath);
delete brush;
delete gpath;
}
这是编译器调用:
['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']
我怀疑这与gcc有关,而不是代码。代码有什么问题?需要为 gcc 提供哪些开关/标志来解决问题?
我在 Windows 7 64bit 上使用 gcc(rev3,由 MinGW-builds 项目构建)4.8.1。
免责声明:我不懂 C++。