Gnatmake undefined reference(libcairo)

时间:2015-01-23 19:34:28

标签: linker ada undefined-reference gnat

如果我尝试编译GNAT Programming Studio 6.1.0w的GtkAda最小示例,我会得到以下内容:

...

gnatlink /home/myuser/own projects/ada/obj/main.ali -shared-libgcc -g -g -L/usr/lib/x86_64-linux-gnu/ -lgtkada -lgmodule-2.0 -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo -lfontconfig -lfreetype -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lX11 -lm -o /home/gabre/own projects/ada/obj/main
/usr/lib/x86_64-linux-gnu//libcairo.so: undefined reference to `pixman_filter_create_separable_convolution'
/usr/lib/x86_64-linux-gnu//libcairo.so: undefined reference to `pixman_glyph_cache_remove'
/usr/lib/x86_64-linux-gnu//libcairo.so: undefined reference to `pixman_glyph_cache_freeze'
/usr/lib/x86_64-linux-gnu//libcairo.so: undefined reference to `pixman_glyph_cache_thaw'
/usr/lib/x86_64-linux-gnu//libcairo.so: undefined reference to `pixman_composite_glyphs'
/usr/lib/x86_64-linux-gnu//libcairo.so: undefined reference to `pixman_glyph_cache_lookup'
/usr/lib/x86_64-linux-gnu//libcairo.so: undefined reference to `pixman_glyph_get_mask_format'
/usr/lib/x86_64-linux-gnu//libcairo.so: undefined reference to `pixman_glyph_cache_insert'
/usr/lib/x86_64-linux-gnu//libcairo.so: undefined reference to `pixman_glyph_cache_create'
/usr/lib/x86_64-linux-gnu//libcairo.so: undefined reference to `pixman_composite_glyphs_no_mask'
collect2: ld returned 1 exit status
gnatlink: error when calling /usr/bin/gcc-4.6

GPS执行的命令:

gnatmake -d -P/home/myuser/own projects/ada/AdaTest.gpr -vP2 -j4 -g

如果我从终端尝试它也可以使用相同的命令,它也适用于GPS 5.0(执行与最新版本相同的命令,6.1.0w) 是什么导致这种情况以及如何使GPS工作?

1 个答案:

答案 0 :(得分:1)

我在comp.lang.ada上问了同样的问题。只是为了记录,Ludovic Brenta的答案是:安装libpixman-1-dev,然后编辑项目文件中的Linker'Linker_Options开关,使其包含“-lpixman-1”。

当从GPS运行时,链接器可能会看到与gtk +一起提供的其中一个库的不同版本,并且这将具有不同的依赖项列表。