编译 lightdm-gtk-greeter-2.0.3.tar.gz 时出现错误,如下所示
make[2]: Leaving directory '/sources/lightdm-1.24.0/lightdm-gtk-greeter-2.0.3/po'
Making all in src
make[2]: Entering directory '/sources/lightdm-1.24.0/lightdm-gtk-greeter-2.0.3/src'
make all-am
make[3]: Entering directory '/sources/lightdm-1.24.0/lightdm-gtk-greeter-2.0.3/src'
CC lightdm_gtk_greeter-lightdm-gtk-greeter.o
lightdm-gtk-greeter.c: In function ‘sigterm_cb’:
lightdm-gtk-greeter.c:447:41: error: cast between incompatible function types from ‘void (*)(GPid, gboolean)’ {aka ‘void (*)(int, int)’} to ‘void (*)(void *, void *)’ [-Werror=cast-function-type]
g_slist_foreach (pids_to_close, (GFunc)close_pid, GINT_TO_POINTER (FALSE));
^
lightdm-gtk-greeter.c: In function ‘menu_command_run’:
lightdm-gtk-greeter.c:927:77: error: cast between incompatible function types from ‘void (*)(GtkWidget *)’ {aka ‘void (*)(struct _GtkWidget *)’} to ‘void (*)(GtkWidget *, void *)’ {aka ‘void (*)(struct _GtkWidget *, void *)’} [-Werror=cast-function-type]
gtk_container_foreach (GTK_CONTAINER (command->widget), (GtkCallback)gtk_widget_destroy, NULL);
^
lightdm-gtk-greeter.c: In function ‘reassign_menu_item_accel’:
lightdm-gtk-greeter.c:1489:57: error: cast between incompatible function types from ‘void (*)(GtkWidget *)’ {aka ‘void (*)(struct _GtkWidget *)’} to ‘void (*)(GtkWidget *, void *)’ {aka ‘void (*)(struct _GtkWidget *, void *)’} [-Werror=cast-function-type]
gtk_container_foreach (GTK_CONTAINER (submenu), (GtkCallback)reassign_menu_item_accel, NULL);
^
lightdm-gtk-greeter.c: In function ‘main’:
lightdm-gtk-greeter.c:2756:33: error: cast between incompatible function types from ‘void (*)(void *)’ to ‘gboolean (*)(void *)’ {aka ‘int (*)(void *)’} [-Werror=cast-function-type]
g_unix_signal_add (SIGTERM, (GSourceFunc)sigterm_cb, /* is_callback */ GINT_TO_POINTER (TRUE));
^
lightdm-gtk-greeter.c:3152:40: error: cast between incompatible function types from ‘gboolean (*)(void)’ {aka ‘int (*)(void)’} to ‘gboolean (*)(void *)’ {aka ‘int (*)(void *)’} [-Werror=cast-function-typ]
gdk_threads_add_timeout (1000, (GSourceFunc) clock_timeout_thread, NULL);
^
cc1: all warnings being treated as errors
make[3]: *** [Makefile:536: lightdm_gtk_greeter-lightdm-gtk-greeter.o] Error 1
make[3]: Leaving directory '/sources/lightdm-1.24.0/lightdm-gtk-greeter-2.0.3/src'
make[2]: *** [Makefile:415: all] Error 2
make[2]: Leaving directory '/sources/lightdm-1.24.0/lightdm-gtk-greeter-2.0.3/src'
make[1]: *** [Makefile:452: all-recursive] Error 1
make[1]: Leaving directory '/sources/lightdm-1.24.0/lightdm-gtk-greeter-2.0.3'
make: *** [Makefile:384: all] Error 2
我正在使用 glibc-2.28 和 gcc-8.2.0。有人可以帮忙吗?
谢谢