2015-10-17 284 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