I've an application¹ that links to gio-unix-2.0 if it exists and to gio-2.0 if not. When I'm building it I get the warning: implicit declaration of function 'g_unix_socket_address_new' Although it seems I'm specifying the CFLAGS correctly. The application uses autotools to build and in configure.ac² I have: PKG_CHECK_MODULES([gio_unix], [gio-unix-2.0 >= $GIO_REQUIRED], [HAVE_GIO_UNIX=yes], [HAVE_GIO_UNIX=no]) if test x"$HAVE_GIO_UNIX" = x"no" ; then PKG_CHECK_MODULES([gio], [gio-2.0 >= $GIO_REQUIRED], [WANT_STATS=yes], [AC_MSG_ERROR([...])]) AC_DEFINE(HAVE_GIO_UNIX, 0, "Define for gio-unix") else AC_DEFINE(HAVE_GIO_UNIX, 1, "Define for gio-unix") fi and in Makefile.am³ I have: AM_CFLAGS += $(gio_unix_CFLAGS) $(glib_CFLAGS) $(gio_CFLAGS) g_unix_socket_address_new is declared in: /usr/include/gio-unix-2.0/gio/gunixsocketaddress.h and when I try to include that file I get: #error "Only <gio/gio.h> can be included directly." So my question is how can I fix this build warning? ¹: http://github.com/alip/mpdcron/ ²: http://github.com/alip/mpdcron/blob/master/configure.ac#L133 ³: http://github.com/alip/mpdcron/blob/master/src/gmodule/stats/Makefile.am#L3 -- Regards, Ali Polatel
Attachment:
pgpvo6ZbPZh1g.pgp
Description: PGP signature