[cairo] 'implicit declaration of function' error during compilation

Andrea Canciani ranma42 at gmail.com
Tue Feb 8 07:05:20 PST 2011


On Tue, Feb 8, 2011 at 3:49 PM, Victor Engmark <victor.engmark at gmail.com> wrote:
> On Tue, Feb 8, 2011 at 1:32 PM, Victor Engmark <victor.engmark at gmail.com> wrote:
>> On Tue, Feb 8, 2011 at 12:18 PM, Andrea Canciani <ranma42 at gmail.com> wrote:
>>> On Tue, Feb 8, 2011 at 12:09 PM, Victor Engmark
>>> <victor.engmark at gmail.com> wrote:
>>>> Hi all,
>>>>
>>>> I have tried for some time now to compile Cairo, but I always run into
>>>> the same problem:
>>>>
>>>>  CC     cairo-bentley-ottmann.lo
>>>> In file included from cairo-bentley-ottmann.c:42:
>>>> cairo-freelist-private.h: In function '_cairo_freepool_alloc_from_pool':
>>>> cairo-freelist-private.h:104: error: implicit declaration of function
>>>> 'VALGRIND_MAKE_MEM_UNDEFINED'
>>>> cairo-freelist-private.h:104: warning: nested extern declaration of
>>>> 'VALGRIND_MAKE_MEM_UNDEFINED'
>>>> cairo-freelist-private.h: In function '_cairo_freepool_alloc':
>>>> cairo-freelist-private.h:117: error: implicit declaration of function
>>>> 'VALGRIND_MAKE_MEM_DEFINED'
>>>> cairo-freelist-private.h:117: warning: nested extern declaration of
>>>> 'VALGRIND_MAKE_MEM_DEFINED'
>>>> cairo-freelist-private.h: In function '_cairo_freepool_free':
>>>> cairo-freelist-private.h:136: error: implicit declaration of function
>>>> 'VALGRIND_MAKE_MEM_NOACCESS'
>>>> cairo-freelist-private.h:136: warning: nested extern declaration of
>>>> 'VALGRIND_MAKE_MEM_NOACCESS'
>>>> make[5]: *** [cairo-bentley-ottmann.lo] Error 1
>>>>
>>>> This seems to be independent of configuration options - It happens
>>>> both with no options and with the full Monty:
>>>> PKG_CONFIG_PATH=$(PKGTOP)$(MY_OPT_DIR)/lib/pkgconfig ./configure \
>>>>                --prefix=$(MY_OPT_DIR) \
>>>>                --sysconfdir=$(ETC_DIR) \
>>>>                --disable-shared \
>>>>                --enable-static \
>>>>                --enable-xlib=no \
>>>>                --enable-xlib-xrender=no \
>>>>                --enable-win32=no
>>>>
>>>> I'm rather new to the intricacies of make, so this is probably my own
>>>> fault. Any tips?
>>>
>>> It looks like it detected valgrind headers, but is then unable to use a
>>> macro it expects to be in there.
>>>
>>> A quick-and-dirty workaround to get cairo building would be to pass
>>> --disable-valgrind as a configure parameter,
>>
>> This works.
>
> I'm not sure if this is related to the same issue, but now it fails
> with a different error:
>
> make[6]: Entering directory `.../cairo/cairo-1.10.2/util/cairo-gobject'
>  CC     libcairo_gobject_la-cairo-gobject-enums.lo
> In file included from cairo-gobject-enums.c:8:
> cairo-gobject.h:44:25: error: glib-object.h: No such file or directory

This looks unrelated.

>
> http://patchwork.openembedded.org/patch/3184/ might be relevant, but I
> don't see how. Do I really have to modify the code to make this
> compile?

You can --disable-gobject.

In this case the correct fix would be fix the glib-gobject package info to
point at the correct directories. In particular, the command:

  pkg-config --cflags gobject-2.0

should print a list of include directory flags which make it possible for
the compiler to find glib-gobject.h

Andrea


More information about the cairo mailing list