2015-10-17 132 views
0

我跟随此post来构建和安装cairo。无法解析的外部符号:__cairo_path_fixed_stroke_to_traps

不过,我被困与下面的错误:

Error 277 error LNK2019: unresolved external symbol __cairo_path_fixed_stroke_to_traps referenced in function __cairo_traps_compositor_stroke C:\gtk_compilation\cairo\cairo-1.12.18\msvc\vs10\cairo-traps-compositor.obj cairo 

安装指南说,我需要关闭,我没有使用的/GL-编译器标志整个程序优化 但仍然没有办法围绕这个问题。

下面是从C:\gtk_compilation\cairo\cairo-1.12.18\msvc\vs10\cairo-traps-compositor.c文件的摘录:

cairo_int_status_t (*func) (const cairo_path_fixed_t *path, 
       const cairo_stroke_style_t *stroke_style, 
       const cairo_matrix_t *ctm, 
       const cairo_matrix_t *ctm_inverse, 
       double   tolerance, 
       cairo_traps_t  *traps); 
composite_traps_info_t info; 
unsigned flags; 

if (antialias == CAIRO_ANTIALIAS_BEST || antialias == CAIRO_ANTIALIAS_GOOD) { 
     func = _cairo_path_fixed_stroke_polygon_to_traps; 
     flags = 0; 
    } else { 
     func = _cairo_path_fixed_stroke_to_traps; /* line#2183 */ 
     flags = need_bounded_clip (extents) & ~NEED_CLIP_SURFACE; 
    } 

上述功能在cairoint.h被定义为:

cairo_private cairo_int_status_t 
_cairo_path_fixed_stroke_to_traps (const cairo_path_fixed_t *path, 
        const cairo_stroke_style_t *stroke_style, 
        const cairo_matrix_t *ctm, 
        const cairo_matrix_t *ctm_inverse, 
        double  tolerance, 
        cairo_traps_t *traps); 

cairo_private cairo_int_status_t 
_cairo_path_fixed_stroke_polygon_to_traps (const cairo_path_fixed_t *path, 
         const cairo_stroke_style_t *stroke_style, 
         const cairo_matrix_t *ctm, 
         const cairo_matrix_t *ctm_inverse, 
         double  tolerance, 
         cairo_traps_t *traps); 

有谁请提出解决类似的问题?

+1

cairoint.h不是定义函数的地方;它是宣布的地方。该函数在cairo-path-stroke-traps.c中定义。该文件正在编译?它是否被链接? – andlabs

+0

谢谢你,我只是发现这个特定的文件不在项目源文件中。天哪,为什么我没有检查过这个? – sjsam

回答

0

继@andlabs评论,我发现文件cairo-path-stroke-traps.c未包含在Visual Studio项目源文件中。增加了这个并重建了解决方案 - Voila!

+0

呵呵,开罗的哪些分布不包括那个文件?这需要被修复... – andlabs

+0

@andlabs:我从官方网站和Visual Studio项目文件从这里下载了tarball(这里是https://wiki.gnome.org/Projects/GTK%2B/Win32 /MSVCCompilationOfGTKStack?action=AttachFile&do=get&target=cairo-vsprojects.zip)。项目文件有可能过时,但即使如此,也很难错过cairo-path-stroke-traps.c.iMHO。 – sjsam