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

Andrea Canciani ranma42 at gmail.com
Tue Feb 8 05:11:47 PST 2011


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.
>
>> but if you want to debug
>> the problem you should probably look in config.log and see what
>> valgrind headers cairo is using (and why the don't contain
>> VALGRIND_MAKE_MEM_... macros).
>
> I'm using Valgrind 3.1.0; is that too old?

I had a look at valgrind release history and it looks like this
changed in 3.2.0.

The autoconf checks for valgrind and its features should be improved
to handle your build setting and any older valgrind version in a more
sane way.

Andrea


More information about the cairo mailing list