Maato / volumeicon

Volume Icon aims to be a lightweight volume control that sits in your systray.
http://nullwise.com/volumeicon.html
GNU General Public License v3.0
183 stars 45 forks source link

error: #error "Only <glib.h> can be included directly." #12

Closed rubik closed 12 years ago

rubik commented 12 years ago

I'm getting this error while trying to compile:

$ make
Making all in src
make[1]: Entering directory `/home/miki/Downloads/volumeicon-0.4.6/src'
gcc -DPACKAGE_NAME=\"volumeicon\" -DPACKAGE_TARNAME=\"volumeicon\" -DPACKAGE_VERSION=\"0.4.6\" -DPACKAGE_STRING=\"volumeicon\ 0.4.6\" -DPACKAGE_BUGREPORT=\"http://www.softwarebakery.com/maato/volumeicon.html\" -DPACKAGE_URL=\"\" -DPACKAGE=\"volumeicon\" -DVERSION=\"0.4.6\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STDLIB_H=1 -DHAVE_MALLOC=1 -DRETSIGTYPE=void -DHAVE_FORK=1 -DHAVE_VFORK=1 -DHAVE_WORKING_VFORK=1 -DHAVE_WORKING_FORK=1 -I.    -Wall -DDATADIR=\"/usr/local/share/volumeicon\" -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng15 -I/usr/include/alsa  -g -O2 -MT volumeicon.o -MD -MP -MF .deps/volumeicon.Tpo -c -o volumeicon.o volumeicon.c
volumeicon.c: In function ‘volume_icon_load_icons’:
volumeicon.c:764:4: warning: ‘gdk_pixbuf_unref’ is deprecated (declared at /usr/include/gdk-pixbuf-2.0/gdk-pixbuf/gdk-pixbuf-core.h:243): Use 'g_object_unref' instead [-Wdeprecated-declarations]
mv -f .deps/volumeicon.Tpo .deps/volumeicon.Po
gcc -DPACKAGE_NAME=\"volumeicon\" -DPACKAGE_TARNAME=\"volumeicon\" -DPACKAGE_VERSION=\"0.4.6\" -DPACKAGE_STRING=\"volumeicon\ 0.4.6\" -DPACKAGE_BUGREPORT=\"http://www.softwarebakery.com/maato/volumeicon.html\" -DPACKAGE_URL=\"\" -DPACKAGE=\"volumeicon\" -DVERSION=\"0.4.6\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STDLIB_H=1 -DHAVE_MALLOC=1 -DRETSIGTYPE=void -DHAVE_FORK=1 -DHAVE_VFORK=1 -DHAVE_WORKING_VFORK=1 -DHAVE_WORKING_FORK=1 -I.    -Wall -DDATADIR=\"/usr/local/share/volumeicon\" -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng15 -I/usr/include/alsa  -g -O2 -MT config.o -MD -MP -MF .deps/config.Tpo -c -o config.o config.c
mv -f .deps/config.Tpo .deps/config.Po
gcc -DPACKAGE_NAME=\"volumeicon\" -DPACKAGE_TARNAME=\"volumeicon\" -DPACKAGE_VERSION=\"0.4.6\" -DPACKAGE_STRING=\"volumeicon\ 0.4.6\" -DPACKAGE_BUGREPORT=\"http://www.softwarebakery.com/maato/volumeicon.html\" -DPACKAGE_URL=\"\" -DPACKAGE=\"volumeicon\" -DVERSION=\"0.4.6\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STDLIB_H=1 -DHAVE_MALLOC=1 -DRETSIGTYPE=void -DHAVE_FORK=1 -DHAVE_VFORK=1 -DHAVE_WORKING_VFORK=1 -DHAVE_WORKING_FORK=1 -I.    -Wall -DDATADIR=\"/usr/local/share/volumeicon\" -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng15 -I/usr/include/alsa  -g -O2 -MT bind.o -MD -MP -MF .deps/bind.Tpo -c -o bind.o bind.c
mv -f .deps/bind.Tpo .deps/bind.Po
gcc -DPACKAGE_NAME=\"volumeicon\" -DPACKAGE_TARNAME=\"volumeicon\" -DPACKAGE_VERSION=\"0.4.6\" -DPACKAGE_STRING=\"volumeicon\ 0.4.6\" -DPACKAGE_BUGREPORT=\"http://www.softwarebakery.com/maato/volumeicon.html\" -DPACKAGE_URL=\"\" -DPACKAGE=\"volumeicon\" -DVERSION=\"0.4.6\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STDLIB_H=1 -DHAVE_MALLOC=1 -DRETSIGTYPE=void -DHAVE_FORK=1 -DHAVE_VFORK=1 -DHAVE_WORKING_VFORK=1 -DHAVE_WORKING_FORK=1 -I.    -Wall -DDATADIR=\"/usr/local/share/volumeicon\" -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng15 -I/usr/include/alsa  -g -O2 -MT alsa_backend.o -MD -MP -MF .deps/alsa_backend.Tpo -c -o alsa_backend.o alsa_backend.c
In file included from alsa_backend.c:25:0:
/usr/include/glib-2.0/glib/gstring.h:28:2: error: #error "Only <glib.h> can be included directly."
In file included from /usr/include/glib-2.0/glib/gstring.h:34:0,
                 from alsa_backend.c:25:
/usr/include/glib-2.0/glib/gtypes.h:28:2: error: #error "Only <glib.h> can be included directly."
In file included from /usr/lib/glib-2.0/include/glibconfig.h:9:0,
                 from /usr/include/glib-2.0/glib/gtypes.h:34,
                 from /usr/include/glib-2.0/glib/gstring.h:34,
                 from alsa_backend.c:25:
/usr/include/glib-2.0/glib/gmacros.h:32:2: error: #error "Only <glib.h> can be included directly."
In file included from /usr/include/glib-2.0/glib/gtypes.h:35:0,
                 from /usr/include/glib-2.0/glib/gstring.h:34,
                 from alsa_backend.c:25:
/usr/include/glib-2.0/glib/gmacros.h:32:2: error: #error "Only <glib.h> can be included directly."
In file included from /usr/include/glib-2.0/glib/gtypes.h:36:0,
                 from /usr/include/glib-2.0/glib/gstring.h:34,
                 from alsa_backend.c:25:
/usr/include/glib-2.0/glib/gversionmacros.h:28:2: error: #error "Only <glib.h> can be included directly."
In file included from /usr/include/glib-2.0/glib/gstring.h:35:0,
                 from alsa_backend.c:25:
/usr/include/glib-2.0/glib/gunicode.h:23:2: error: #error "Only <glib.h> can be included directly."
In file included from /usr/include/glib-2.0/glib/gunicode.h:29:0,
                 from /usr/include/glib-2.0/glib/gstring.h:35,
                 from alsa_backend.c:25:
/usr/include/glib-2.0/glib/gerror.h:22:2: error: #error "Only <glib.h> can be included directly."
In file included from /usr/include/glib-2.0/glib/gerror.h:30:0,
                 from /usr/include/glib-2.0/glib/gunicode.h:29,
                 from /usr/include/glib-2.0/glib/gstring.h:35,
                 from alsa_backend.c:25:
/usr/include/glib-2.0/glib/gquark.h:28:2: error: #error "Only <glib.h> can be included directly."
In file included from /usr/include/glib-2.0/glib/gquark.h:34:0,
                 from /usr/include/glib-2.0/glib/gerror.h:30,
                 from /usr/include/glib-2.0/glib/gunicode.h:29,
                 from /usr/include/glib-2.0/glib/gstring.h:35,
                 from alsa_backend.c:25:
/usr/include/glib-2.0/glib/gtypes.h:28:2: error: #error "Only <glib.h> can be included directly."
In file included from /usr/include/glib-2.0/glib/gunicode.h:30:0,
                 from /usr/include/glib-2.0/glib/gstring.h:35,
                 from alsa_backend.c:25:
/usr/include/glib-2.0/glib/gtypes.h:28:2: error: #error "Only <glib.h> can be included directly."
In file included from /usr/include/glib-2.0/glib/gstring.h:36:0,
                 from alsa_backend.c:25:
/usr/include/glib-2.0/glib/gutils.h:28:2: error: #error "Only <glib.h> can be included directly."
In file included from /usr/include/glib-2.0/glib/gutils.h:34:0,
                 from /usr/include/glib-2.0/glib/gstring.h:36,
                 from alsa_backend.c:25:
/usr/include/glib-2.0/glib/gtypes.h:28:2: error: #error "Only <glib.h> can be included directly."
In file included from alsa_backend.c:27:0:
/usr/include/glib-2.0/glib/glist.h:28:2: error: #error "Only <glib.h> can be included directly."
In file included from alsa_backend.c:28:0:
/usr/include/glib-2.0/glib/giochannel.h:28:2: error: #error "Only <glib.h> can be included directly."
make[1]: *** [alsa_backend.o] Error 1
make[1]: Leaving directory `/home/miki/Downloads/volumeicon-0.4.6/src'
make: *** [all-recursive] Error 1
rubik commented 12 years ago

Solved with this patch:

diff -ru volumeicon-0.4.6/src/alsa_backend.c volumeicon-0.4.6.mine/src/alsa_backend.c
--- volumeicon-0.4.6/src/alsa_backend.c 2011-10-25 15:35:10.000000000 +0200
+++ volumeicon-0.4.6.mine/src/alsa_backend.c    2012-05-23 10:29:25.330032316 +0200
@@ -22,10 +22,7 @@
 //##############################################################################

 #include <alsa/asoundlib.h>
-#include <glib/gstring.h>
-#include <glib/gstdio.h>
-#include <glib/glist.h>
-#include <glib/giochannel.h>
+#include <glib.h>

 #include "alsa_backend.h"
drew1kun commented 7 years ago

Thank you very much!!! This is helpful!