Compilation error with GIMP git version
This discussion is connected to the gimp-developer-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.
This is a read-only list on gimpusers.com so this discussion thread is read-only, too.
Compilation error with GIMP git version | Carmelo DrRaw | 27 Jun 14:35 |
Compilation error with GIMP git version | Michael Natterer | 29 Jun 16:41 |
Compilation error with GIMP git version
Dear developers,
I am getting the following compilation error with the current git version of GIMP, using gcc 4.8.5:
gcc -DHAVE_CONFIG_H -I. -I../.. -I../.. -pthread -I/zzz/include/gtk-2.0 -I/zzz/lib/gtk-2.0/include -I/zzz/include/atk-1.0 -I/zzz/include/cairo -I/zzz/include/gdk-pixbuf-2.0 -I/zzz/include/pango-1.0 -I/zzz/include/glib-2.0 -I/zzz/lib/glib-2.0/include -I/zzz/include/pixman-1 -I/zzz/include/freetype2 -I/zzz/include/libpng16 -I/zzz/include/harfbuzz -pthread -I/zzz/include/gegl-0.3 -I/zzz/include/json-glib-1.0 -I/zzz/include/gio-unix-2.0/ -I/zzz/include/babl-0.1 -I/zzz/include/glib-2.0 -I/zzz/lib/glib-2.0/include -I/zzz/include -DGIMP_DISABLE_DEPRECATED -DBABL_DISABLE_DEPRECATED -DGSEAL_ENABLE -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED -DGDK_MULTIHEAD_SAFE -DGTK_MULTIHEAD_SAFE -g -O2 -Wall -Wdeclaration-after-statement -Wmissing-prototypes -Werror=missing-prototypes -Wmissing-declarations -Winit-self -Wpointer-arith -Wmissing-format-attribute -Wformat-security -Wlogical-op -Wtype-limits -fno-common -fdiagnostics-show-option -Wreturn-type -MT file-pcx.o -MD -MP -MF .deps/file-pcx.Tpo -c -o file-pcx.o file-pcx.c
file-pcx.c: In function ‘save_less_than_8’:
file-pcx.c:943:3: error: ‘for’ loop initial declarations are only allowed in C99 mode
for (gint x = 0; x < buf_size; x++)
^
file-pcx.c:943:3: note: use option -std=c99 or -std=gnu99 to compile your code
make[3]: *** [file-pcx.o] Error 1
The solution is simple, and consists of moving the declaration of
gint x
in file-pcx.c outside of the for loop, for example immediately after
guchar *line;
Hope this helps!
Compilation error with GIMP git version
Thanks, fixed in master:
commit 34485cff869655fada8914245e124990d0d6d87b
Author: Michael Natterer
Date: Thu Jun 29 18:39:41 2017 +0200
plug-ins: don't say for(int x...) in file-pcx.c
plug-ins/common/file-pcx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
On Tue, 2017-06-27 at 16:35 +0200, Carmelo DrRaw wrote:
Dear developers,
I am getting the following compilation error with the current git version of GIMP, using gcc 4.8.5:
gcc -DHAVE_CONFIG_H -I. -I../.. -I../.. -pthread -I/zzz/include/gtk- 2.0 -I/zzz/lib/gtk-2.0/include -I/zzz/include/atk-1.0 -I/zzz/include/cairo -I/zzz/include/gdk-pixbuf-2.0 -I/zzz/include/pango-1.0 -I/zzz/include/glib-2.0 -I/zzz/lib/glib- 2.0/include -I/zzz/include/pixman-1 -I/zzz/include/freetype2 -I/zzz/include/libpng16 -I/zzz/include/harfbuzz -pthread -I/zzz/include/gegl-0.3 -I/zzz/include/json-glib-1.0 -I/zzz/include/gio-unix-2.0/ -I/zzz/include/babl-0.1 -I/zzz/include/glib-2.0 -I/zzz/lib/glib-2.0/include -I/zzz/include -DGIMP_DISABLE_DEPRECATED -DBABL_DISABLE_DEPRECATED -DGSEAL_ENABLE -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED -DGDK_MULTIHEAD_SAFE -DGTK_MULTIHEAD_SAFE -g -O2 -Wall -Wdeclaration-after-statement -Wmissing-prototypes -Werror=missing- prototypes -Wmissing-declarations -Winit-self -Wpointer-arith - Wmissing-format-attribute -Wformat-security -Wlogical-op -Wtype- limits -fno-common -fdiagnostics-show-option -Wreturn-type -MT file-pcx.o -MD -MP -MF .deps/file-pcx.Tpo -c -o file-pcx.o file-pcx.c file-pcx.c: In function ‘save_less_than_8’: file-pcx.c:943:3: error: ‘for’ loop initial declarations are only allowed in C99 mode
for (gint x = 0; x < buf_size; x++) ^
file-pcx.c:943:3: note: use option -std=c99 or -std=gnu99 to compile your code
make[3]: *** [file-pcx.o] Error 1The solution is simple, and consists of moving the declaration of
gint x
in file-pcx.c outside of the for loop, for example immediately after
guchar *line;
Hope this helps! _______________________________________________ gimp-developer-list mailing list
List address: gimp-developer-list@gnome.org List membership: https://mail.gnome.org/mailman/listinfo/gimp-develop er-list
List archives: https://mail.gnome.org/archives/gimp-developer-list