Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error build version 1.9.0 #128

Closed
berkut-174 opened this issue May 28, 2021 · 2 comments
Closed

Error build version 1.9.0 #128

berkut-174 opened this issue May 28, 2021 · 2 comments

Comments

@berkut-174
Copy link

Hi, since version 1.9.0 I get an error when I build:

Making all in src
make[1]: вход в каталог «/tmp/viking/src»
make  all-recursive
make[2]: вход в каталог «/tmp/viking/src»
Making all in icons
make[3]: вход в каталог «/tmp/viking/src/icons»
make  all-am
make[4]: вход в каталог «/tmp/viking/src/icons»
make[4]: Цель «all-am» не требует выполнения команд.
make[4]: выход из каталога «/tmp/viking/src/icons»
make[3]: выход из каталога «/tmp/viking/src/icons»
make[3]: вход в каталог «/tmp/viking/src»
depbase=`echo datasource_gc.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
gcc -DHAVE_CONFIG_H -I.  -pthread -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng16 -I/usr/include/json-glib-1.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -pthread -I/usr/include/gtk-3.0 -I/usr/include/gio-unix-2.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/freetype2 -I/usr/include/harfbuzz -I/usr/include/libpng16 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng16 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -DVIKING_DATADIR=\""/usr/local/share/viking"\" -DVIKING_SYSCONFDIR=\""/usr/local/etc/viking"\"  -Wall -g -D_GNU_SOURCE -pthread -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng16 -I/usr/include/json-glib-1.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -pthread -I/usr/include/gtk-3.0 -I/usr/include/gio-unix-2.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/freetype2 -I/usr/include/harfbuzz -I/usr/include/libpng16 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng16 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -pthread -I/usr/include/libgeoclue-2.0 -I/usr/include/gio-unix-2.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/libzip -MT datasource_gc.o -MD -MP -MF $depbase.Tpo -c -o datasource_gc.o datasource_gc.c &&\
mv -f $depbase.Tpo $depbase.Po
datasource_gc.c: In function ‘datasource_gc_draw_circle’:
datasource_gc.c:130:5: error: too few arguments to function ‘vik_viewport_draw_arc’
     vik_viewport_draw_arc ( widgets->vvp, widgets->circle_gc, FALSE,
     ^~~~~~~~~~~~~~~~~~~~~
In file included from viking.h:53,
                 from datasource_gc.c:26:
vikviewport.h:189:6: note: declared here
 void vik_viewport_draw_arc ( VikViewport *vvp, GdkGC *gc, gboolean filled, gint x, gint y, gint width, gint height, gint angle1, gint angle2, GdkColor *gcolor );
      ^~~~~~~~~~~~~~~~~~~~~
datasource_gc.c:160:31: warning: implicit declaration of function ‘gtk_spin_button_get_value_as_float’; did you mean ‘gtk_spin_button_get_value_as_int’? [-Wimplicit-function-declaration]
       widgets->circle_width = gtk_spin_button_get_value_as_float ( GTK_SPIN_BUTTON(widgets->miles_radius_spin) )
                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                               gtk_spin_button_get_value_as_int
datasource_gc.c:163:7: error: too few arguments to function ‘vik_viewport_draw_arc’
       vik_viewport_draw_arc ( widgets->vvp, widgets->circle_gc, FALSE,
       ^~~~~~~~~~~~~~~~~~~~~
In file included from viking.h:53,
                 from datasource_gc.c:26:
vikviewport.h:189:6: note: declared here
 void vik_viewport_draw_arc ( VikViewport *vvp, GdkGC *gc, gboolean filled, gint x, gint y, gint width, gint height, gint angle1, gint angle2, GdkColor *gcolor );
      ^~~~~~~~~~~~~~~~~~~~~
datasource_gc.c:175:3: error: too few arguments to function ‘vik_viewport_sync’
   vik_viewport_sync ( widgets->vvp );
   ^~~~~~~~~~~~~~~~~
In file included from viking.h:53,
                 from datasource_gc.c:26:
vikviewport.h:143:6: note: declared here
 void vik_viewport_sync ( VikViewport *vvp, GdkGC *cr );
      ^~~~~~~~~~~~~~~~~
datasource_gc.c: In function ‘datasource_gc_add_setup_widgets’:
datasource_gc.c:200:3: warning: implicit declaration of function ‘gdk_gc_set_function’; did you mean ‘gdk_window_set_functions’? [-Wimplicit-function-declaration]
   gdk_gc_set_function ( widgets->circle_gc, GDK_INVERT );
   ^~~~~~~~~~~~~~~~~~~
   gdk_window_set_functions
datasource_gc.c:200:45: error: ‘GDK_INVERT’ undeclared (first use in this function); did you mean ‘GDK_XTERM’?
   gdk_gc_set_function ( widgets->circle_gc, GDK_INVERT );
                                             ^~~~~~~~~~
                                             GDK_XTERM
datasource_gc.c:200:45: note: each undeclared identifier is reported only once for each function it appears in
datasource_gc.c: In function ‘datasource_gc_get_process_options’:
datasource_gc.c:240:103: warning: format ‘%f’ expects argument of type ‘double’, but argument 4 has type ‘int’ [-Wformat=]
   po->shell_command = g_strdup_printf( "rm -f ~/.geo/caches/*.html ; %s -H ~/.geo/caches -P -n%d -r%.1fM -u %s -p %s %s %s ; %s -z ~/.geo/caches/*.html ",
                                                                                                    ~~~^
                                                                                                    %.1d
datasource_gc.c:243:6:
      gtk_spin_button_get_value_as_float ( GTK_SPIN_BUTTON(widgets->miles_radius_spin) ),
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                
datasource_gc.c: In function ‘datasource_gc_cleanup’:
datasource_gc.c:258:5: error: too few arguments to function ‘vik_viewport_draw_arc’
     vik_viewport_draw_arc ( widgets->vvp, widgets->circle_gc, FALSE,
     ^~~~~~~~~~~~~~~~~~~~~
In file included from viking.h:53,
                 from datasource_gc.c:26:
vikviewport.h:189:6: note: declared here
 void vik_viewport_draw_arc ( VikViewport *vvp, GdkGC *gc, gboolean filled, gint x, gint y, gint width, gint height, gint angle1, gint angle2, GdkColor *gcolor );
      ^~~~~~~~~~~~~~~~~~~~~
datasource_gc.c:262:5: error: too few arguments to function ‘vik_viewport_sync’
     vik_viewport_sync( widgets->vvp );
     ^~~~~~~~~~~~~~~~~
In file included from viking.h:53,
                 from datasource_gc.c:26:
vikviewport.h:143:6: note: declared here
 void vik_viewport_sync ( VikViewport *vvp, GdkGC *cr );
      ^~~~~~~~~~~~~~~~~
make[3]: *** [Makefile:1082: datasource_gc.o] Ошибка 1
make[3]: выход из каталога «/tmp/viking/src»
make[2]: *** [Makefile:1141: all-recursive] Ошибка 1
make[2]: выход из каталога «/tmp/viking/src»
make[1]: *** [Makefile:804: all] Ошибка 2
make[1]: выход из каталога «/tmp/viking/src»
make: *** [Makefile:460: all-recursive] Ошибка 1

Version 1.8.0 did not have this problem. Have any ideas how to fix it?

@rnorris
Copy link
Collaborator

rnorris commented May 28, 2021

Oops.
You appear to be building Viking with the little used build option '--enable-geocaches', otherwise the file datasource_gc.c is not normally built.
Which unfortunately hasn't been updated for the now default GTK3 build.

So there are some work arounds that immediately come to mind:

  1. Force the build to use GTK2. You will need to clean the build area first (e.g make clean) or start a fresh (otherwise you will get linker errors).
    Use configure --enable-gtk2

  2. Ensure using default build options to avoid using this broken code.

  3. Fix the code!
    I believe adding an extra parameter of NULL to each call to vik_viewport_draw_arc() in datasource_gc.c should work.
    Compare with the usage of vik_viewport_draw_arc() in the file viktrwlayer.c
    Also gdk_gc_set_function() used on line 200 - needs to be either commented out or made to be only included in the GTK2 version - such as surrounding it by #if !GTK_CHECK_VERSION (3,0,0) and #endif
    I've not had time to try this yet though.

HTH.

@berkut-174
Copy link
Author

Indeed, by removing the --enable-geocaches option, the build was successful.
Perhaps it is worth adding a condition as you wrote, but I do not use geocaching, so I did not check it.
Thank.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants