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

Andrea Canciani ranma42 at gmail.com
Tue Feb 8 07:31:26 PST 2011


On Tue, Feb 8, 2011 at 4:15 PM, Victor Engmark <victor.engmark at gmail.com> wrote:
> On Tue, Feb 8, 2011 at 4:05 PM, Andrea Canciani <ranma42 at gmail.com> wrote:
>> 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
>
> pkg-config works with the PKG_CONFIG_PATH which was used for both GLIB
> and Cairo compilation:
>
> $ PKG_CONFIG_PATH=[...]/usr/opt/cairopango/lib/pkgconfig pkg-config
> --cflags gobject-2.0
> -pthread -I/usr/opt/cairopango/include/glib-2.0
> -I/usr/opt/cairopango/lib/glib-2.0/include
>
> Are these paths absolute or relative? Because the files are installed
> in a directory relative to the above "[...]" path:

The paths are absolute (they start with '/').

>
> $ find [...] -name glib-object.h
> [...]/usr/opt/cairopango/include/glib-2.0/glib-object.h
>
> Is this maybe related to a problem in Glib 2.24.2 (which otherwise
> compiled fine)?
>
> $ PKG_CONFIG_PATH=[...]/usr/opt/cairopango/lib/pkgconfig pkg-config
> --cflags glib
> sh: glib-config: command not found
> sh: glib-config: command not found
> sh: glib-config: command not found
>
> ...or the result of the Cairo configuration?

It looks like you should be using a chroot build environment or some
symlink trickery. Your configuration files seem to assume that you have
[...] as the root of your environment.

>
> cairo (version 1.10.2 [release]) will be compiled with:
>
> The following surface backends:
>  Image:         yes (always builtin)
>  Recording:     yes (always builtin)
>  Tee:           no (disabled, use --enable-tee to enable)
>  XML:           no (disabled, use --enable-xml to enable)
>  Skia:          no (disabled, use --enable-skia to enable)
>  Xlib:          no (disabled, use --enable-xlib to enable)
>  Xlib Xrender:  no (disabled, use --enable-xlib-xrender to enable)
>  Qt:            no (disabled, use --enable-qt to enable)
>  Quartz:        no (requires CoreGraphics framework)
>  Quartz-image:  no (disabled, use --enable-quartz-image to enable)
>  XCB:           no (disabled, use --enable-xcb to enable)
>  Win32:         no (disabled, use --enable-win32 to enable)
>  OS2:           no (disabled, use --enable-os2 to enable)
>  CairoScript:   no (disabled, use --enable-script to enable)
>  PostScript:    yes
>  PDF:           yes
>  SVG:           yes
>  OpenGL:        no (disabled, use --enable-gl to enable)
>  BeOS:          no (disabled, use --enable-beos to enable)
>  DirectFB:      no (disabled, use --enable-directfb to enable)
>  OpenVG:        no (disabled, use --enable-vg to enable)
>  DRM:           no (disabled, use --enable-drm to enable)
>
> The following font backends:
>  User:          yes (always builtin)
>  FreeType:      yes
>  Fontconfig:    yes
>  Win32:         no (disabled, use --enable-win32 to enable)
>  Quartz:        no (requires CoreGraphics framework)
>
> The following functions:
>  PNG functions:   yes
>  GLEW functions:  no (not required by any backend)
>  GLX functions:   no (not required by any backend)
>  WGL functions:   no (not required by any backend)
>  EGL functions:   no (not required by any backend)
>  X11-xcb functions: no (disabled, use --enable-xlib-xcb to enable)
>  XCB-drm functions: no (disabled, use --enable-xcb-drm to enable)
>  XCB-shm functions: no (requires --enable-xcb)
>  DRM-Xr functions: no (disabled, use --enable-drm-xr to enable)
>
> The following features and utilities:
>  cairo-trace:                yes
>  cairo-script-interpreter:   yes
>
> And the following internal features:
>  pthread:       yes
>  gtk-doc:       no
>  gcov support:  no
>  symbol-lookup: no (requires bfd)
>  test surfaces: no (disabled, use --enable-test-surfaces to enable)
>  ps testing:    no (requires libspectre)
>  pdf testing:   no (requires poppler-glib >= 0.13.3)
>  svg testing:   no (requires librsvg-2.0 >= 2.15.0)
>
>
> *** No native surface backends enabled for your platform. It is strongly
> *** recommended that you enable the native surface backend feature for your
> *** platform.
>
> --
> Victor Engmark
>


More information about the cairo mailing list