mattn / go-gtk

Go binding for GTK
http://mattn.github.com/go-gtk
BSD 3-Clause "New" or "Revised" License
2.12k stars 247 forks source link

build demo.go error #414

Open hailiangchen opened 4 years ago

hailiangchen commented 4 years ago

D:\go\src\github.com\mattn\go-gtk\_example\demo>go build demo.go
# github.com/mattn/go-gtk/glib
In file included from glib.go:5,
                 from _cgo_export.c:4:
..\..\glib/glib.go.h:183:1: warning: 'GThreadFunctions' is deprecated [-Wdeprecated-declarations]
  183 | static void _g_thread_init(GThreadFunctions *vtable) {
      | ^~~~~~
In file included from C:/msys64/mingw64/include/glib-2.0/glib.h:111,
                 from ..\..\glib/glib.go.h:4,
                 from glib.go:5,
                 from _cgo_export.c:4:
C:/msys64/mingw64/include/glib-2.0/glib/deprecated/gthread.h:56:8: note: declared here
   56 | struct _GThreadFunctions
      |        ^~~~~~~~~~~~~~~~~
# github.com/mattn/go-gtk/glib
In file included from ..\..\glib\glib.go:5:
..\..\glib/glib.go.h:183:1: warning: 'GThreadFunctions' is deprecated [-Wdeprecated-declarations]
  183 | static void _g_thread_init(GThreadFunctions *vtable) {
      | ^~~~~~
In file included from C:/msys64/mingw64/include/glib-2.0/glib.h:111,
                 from ..\..\glib/glib.go.h:4,
                 from ..\..\glib\glib.go:5:
C:/msys64/mingw64/include/glib-2.0/glib/deprecated/gthread.h:56:8: note: declared here
   56 | struct _GThreadFunctions
      |        ^~~~~~~~~~~~~~~~~
cgo-gcc-prolog: In function '_cgo_d563e2f75b38_Cfunc__g_thread_init':
cgo-gcc-prolog:192:3: warning: 'GThreadFunctions' is deprecated [-Wdeprecated-declarations]
In file included from C:/msys64/mingw64/include/glib-2.0/glib.h:111,
                 from ..\..\glib/glib.go.h:4,
                 from ..\..\glib\glib.go:5:
C:/msys64/mingw64/include/glib-2.0/glib/deprecated/gthread.h:56:8: note: declared here
   56 | struct _GThreadFunctions
      |        ^~~~~~~~~~~~~~~~~
go build github.com/mattn/go-gtk/gdk: invalid flag in pkg-config --libs: -Wl,-luuid


cnchef commented 4 years ago

build demo err execution environment: os: Windows 10 go: go version go1.14.2 windows/amd64 gtk: mingw-w64-x86_64-gtk2-2.24.32-6 mingw-w64-x86_64-gtk3-3.24.23-3

E:\go\src\github.com\mattn\go-gtk_example\demo>go build demo.go

github.com/mattn/go-gtk/glib

In file included from glib.go:5, from _cgo_export.c:4: E:\go\src\github.com\mattn\go-gtk\glib/glib.go.h:183:1: warning: 'GThreadFunctions' is deprecated [-Wdeprecated-declarations] static void _g_thread_init(GThreadFunctions *vtable) { ^~ In file included from C:/msys64/mingw64/include/glib-2.0/glib.h:111, from E:\go\src\github.com\mattn\go-gtk\glib/glib.go.h:4, from glib.go:5, from _cgo_export.c:4: C:/msys64/mingw64/include/glib-2.0/glib/deprecated/gthread.h:56:8: note: declared here struct _GThreadFunctions ^~~~~

github.com/mattn/go-gtk/glib

In file included from E:\go\src\github.com\mattn\go-gtk\glib\glib.go:5: E:\go\src\github.com\mattn\go-gtk\glib/glib.go.h:183:1: warning: 'GThreadFunctions' is deprecated [-Wdeprecated-declarations] static void _g_thread_init(GThreadFunctions *vtable) { ^~ In file included from C:/msys64/mingw64/include/glib-2.0/glib.h:111, from E:\go\src\github.com\mattn\go-gtk\glib/glib.go.h:4, from E:\go\src\github.com\mattn\go-gtk\glib\glib.go:5: C:/msys64/mingw64/include/glib-2.0/glib/deprecated/gthread.h:56:8: note: declared here struct _GThreadFunctions ^~~~~ cgo-gcc-prolog: In function '_cgo_d563e2f75b38_Cfunc__g_thread_init': cgo-gcc-prolog:192:3: warning: 'GThreadFunctions' is deprecated [-Wdeprecated-declarations] In file included from C:/msys64/mingw64/include/glib-2.0/glib.h:111, from E:\go\src\github.com\mattn\go-gtk\glib/glib.go.h:4, from E:\go\src\github.com\mattn\go-gtk\glib\glib.go:5: C:/msys64/mingw64/include/glib-2.0/glib/deprecated/gthread.h:56:8: note: declared here struct _GThreadFunctions ^~~~~

github.com/mattn/go-gtk/gtk

In file included from C:/msys64/mingw64/include/gtk-2.0/gtk/gtkobject.h:37, from C:/msys64/mingw64/include/gtk-2.0/gtk/gtkwidget.h:36, from C:/msys64/mingw64/include/gtk-2.0/gtk/gtkcontainer.h:35, from C:/msys64/mingw64/include/gtk-2.0/gtk/gtkbin.h:35, from C:/msys64/mingw64/include/gtk-2.0/gtk/gtkwindow.h:36, from C:/msys64/mingw64/include/gtk-2.0/gtk/gtkdialog.h:35, from C:/msys64/mingw64/include/gtk-2.0/gtk/gtkaboutdialog.h:32, from C:/msys64/mingw64/include/gtk-2.0/gtk/gtk.h:33, from ....\gtk/gtk.go.h:4, from gtk.go:8, from _cgo_export.c:4: C:/msys64/mingw64/include/gtk-2.0/gtk/gtktypeutils.h:236:1: warning: 'GTypeDebugFlags' is deprecated [-Wdeprecated-declarations] 236 | void gtk_type_init (GTypeDebugFlags debug_flags); | ^~~~ In file included from C:/msys64/mingw64/include/glib-2.0/gobject/gobject.h:24, from C:/msys64/mingw64/include/glib-2.0/gobject/gbinding.h:29, from C:/msys64/mingw64/include/glib-2.0/glib-object.h:22, from C:/msys64/mingw64/include/glib-2.0/gio/gioenums.h:28, from C:/msys64/mingw64/include/glib-2.0/gio/giotypes.h:28, from C:/msys64/mingw64/include/glib-2.0/gio/gio.h:26, from C:/msys64/mingw64/include/gtk-2.0/gdk/gdkapplaunchcontext.h:30, from C:/msys64/mingw64/include/gtk-2.0/gdk/gdk.h:32, from C:/msys64/mingw64/include/gtk-2.0/gtk/gtk.h:32, from ....\gtk/gtk.go.h:4, from gtk.go:8, from _cgo_export.c:4: C:/msys64/mingw64/include/glib-2.0/gobject/gtype.h:679:1: note: declared here 679 | { | ^ In file included from C:/msys64/mingw64/include/gtk-2.0/gtk/gtktoolitem.h:31, from C:/msys64/mingw64/include/gtk-2.0/gtk/gtktoolbutton.h:30, from C:/msys64/mingw64/include/gtk-2.0/gtk/gtkmenutoolbutton.h:30, from C:/msys64/mingw64/include/gtk-2.0/gtk/gtk.h:126, from ....\gtk/gtk.go.h:4, from gtk.go:8, from _cgo_export.c:4: C:/msys64/mingw64/include/gtk-2.0/gtk/gtktooltips.h:73:3: warning: 'GTimeVal' is deprecated: Use 'GDateTime' instead [-Wdeprecated-declarations] 73 | GTimeVal last_popdown; | ^~~~ In file included from C:/msys64/mingw64/include/glib-2.0/glib/galloca.h:32, from C:/msys64/mingw64/include/glib-2.0/glib.h:30, from C:/msys64/mingw64/include/glib-2.0/gobject/gbinding.h:28, from C:/msys64/mingw64/include/glib-2.0/glib-object.h:22, from C:/msys64/mingw64/include/glib-2.0/gio/gioenums.h:28, from C:/msys64/mingw64/include/glib-2.0/gio/giotypes.h:28, from C:/msys64/mingw64/include/glib-2.0/gio/gio.h:26, from C:/msys64/mingw64/include/gtk-2.0/gdk/gdkapplaunchcontext.h:30, from C:/msys64/mingw64/include/gtk-2.0/gdk/gdk.h:32, from C:/msys64/mingw64/include/gtk-2.0/gtk/gtk.h:32, from ....\gtk/gtk.go.h:4, from gtk.go:8, from _cgo_export.c:4: C:/msys64/mingw64/include/glib-2.0/glib/gtypes.h:547:8: note: declared here 547 | struct _GTimeVal | ^~~~~

github.com/mattn/go-gtk/gtk

In file included from C:/msys64/mingw64/include/gtk-2.0/gtk/gtkobject.h:37, from C:/msys64/mingw64/include/gtk-2.0/gtk/gtkwidget.h:36, from C:/msys64/mingw64/include/gtk-2.0/gtk/gtkcontainer.h:35, from C:/msys64/mingw64/include/gtk-2.0/gtk/gtkbin.h:35, from C:/msys64/mingw64/include/gtk-2.0/gtk/gtkwindow.h:36, from C:/msys64/mingw64/include/gtk-2.0/gtk/gtkdialog.h:35, from C:/msys64/mingw64/include/gtk-2.0/gtk/gtkaboutdialog.h:32, from C:/msys64/mingw64/include/gtk-2.0/gtk/gtk.h:33, from ....\gtk/gtk.go.h:4, from ....\gtk\gtk.go:8: C:/msys64/mingw64/include/gtk-2.0/gtk/gtktypeutils.h:236:1: warning: 'GTypeDebugFlags' is deprecated [-Wdeprecated-declarations] 236 | void gtk_type_init (GTypeDebugFlags debug_flags); | ^~~~ In file included from C:/msys64/mingw64/include/glib-2.0/gobject/gobject.h:24, from C:/msys64/mingw64/include/glib-2.0/gobject/gbinding.h:29, from C:/msys64/mingw64/include/glib-2.0/glib-object.h:22, from C:/msys64/mingw64/include/glib-2.0/gio/gioenums.h:28, from C:/msys64/mingw64/include/glib-2.0/gio/giotypes.h:28, from C:/msys64/mingw64/include/glib-2.0/gio/gio.h:26, from C:/msys64/mingw64/include/gtk-2.0/gdk/gdkapplaunchcontext.h:30, from C:/msys64/mingw64/include/gtk-2.0/gdk/gdk.h:32, from C:/msys64/mingw64/include/gtk-2.0/gtk/gtk.h:32, from ....\gtk/gtk.go.h:4, from ....\gtk\gtk.go:8: C:/msys64/mingw64/include/glib-2.0/gobject/gtype.h:679:1: note: declared here 679 | { | ^ In file included from C:/msys64/mingw64/include/gtk-2.0/gtk/gtktoolitem.h:31, from C:/msys64/mingw64/include/gtk-2.0/gtk/gtktoolbutton.h:30, from C:/msys64/mingw64/include/gtk-2.0/gtk/gtkmenutoolbutton.h:30, from C:/msys64/mingw64/include/gtk-2.0/gtk/gtk.h:126, from ....\gtk/gtk.go.h:4, from ....\gtk\gtk.go:8: C:/msys64/mingw64/include/gtk-2.0/gtk/gtktooltips.h:73:3: warning: 'GTimeVal' is deprecated: Use 'GDateTime' instead [-Wdeprecated-declarations] 73 | GTimeVal last_popdown; | ^~~~ In file included from C:/msys64/mingw64/include/glib-2.0/glib/galloca.h:32, from C:/msys64/mingw64/include/glib-2.0/glib.h:30, from C:/msys64/mingw64/include/glib-2.0/gobject/gbinding.h:28, from C:/msys64/mingw64/include/glib-2.0/glib-object.h:22, from C:/msys64/mingw64/include/glib-2.0/gio/gioenums.h:28, from C:/msys64/mingw64/include/glib-2.0/gio/giotypes.h:28, from C:/msys64/mingw64/include/glib-2.0/gio/gio.h:26, from C:/msys64/mingw64/include/gtk-2.0/gdk/gdkapplaunchcontext.h:30, from C:/msys64/mingw64/include/gtk-2.0/gdk/gdk.h:32, from C:/msys64/mingw64/include/gtk-2.0/gtk/gtk.h:32, from ....\gtk/gtk.go.h:4, from ....\gtk\gtk.go:8: C:/msys64/mingw64/include/glib-2.0/glib/gtypes.h:547:8: note: declared here 547 | struct _GTimeVal | ^~~~~

github.com/mattn/go-gtk/gtk

....\gtk\gtk.go:4271:3: cannot type switch on non-interface value val (type string)

cnchef commented 4 years ago

Why is there not to anyone answer?

lzxzlx2016 commented 3 years ago

Why is there not to anyone answer?

因为没人会哈哈哈哈哈哈

huangjie0515 commented 3 years ago

我也遇到了这个问题 ,会不会是win10电脑的问题

yan3485797 commented 3 years ago

any one ?

ghost commented 2 years ago

is there any solution?

Emberwy commented 2 years ago

解决了吗,卡了一天了实在是解决不了

focusfeel commented 1 year ago

github.com/mattn/go-gtk/glib

In file included from glib.go:5, from _cgo_export.c:4: ..........\go\src\github.com\mattn\go-gtk\glib/glib.go.h:183:1: warning: 'GThreadFunctions' is deprecated [-Wdeprecated-declarations]
183 | static void _g_thread_init(GThreadFunctions *vtable) { | ^~ In file included from D:/Msys64/mingw64/include/glib-2.0/glib.h:114, from ..........\go\src\github.com\mattn\go-gtk\glib/glib.go.h:4: D:/Msys64/mingw64/include/glib-2.0/glib/deprecated/gthread.h:58:8: note: declared here 58 | struct _GThreadFunctions | ^~~~~

github.com/mattn/go-gtk/glib

In file included from ..........\go\src\github.com\mattn\go-gtk\glib\glib.go:5: ..........\go\src\github.com\mattn\go-gtk\glib/glib.go.h:183:1: warning: 'GThreadFunctions' is deprecated [-Wdeprecated-declarations]
183 | static void _g_thread_init(GThreadFunctions *vtable) { | ^~ In file included from D:/Msys64/mingw64/include/glib-2.0/glib.h:114, from ..........\go\src\github.com\mattn\go-gtk\glib/glib.go.h:4: D:/Msys64/mingw64/include/glib-2.0/glib/deprecated/gthread.h:58:8: note: declared here 58 | struct _GThreadFunctions | ^~~~~ cgo-gcc-prolog: In function '_cgo_1efdb3e50950_Cfunc__g_thread_init': cgo-gcc-prolog:192:3: warning: 'GThreadFunctions' is deprecated [-Wdeprecated-declarations] D:/Msys64/mingw64/include/glib-2.0/glib/deprecated/gthread.h:58:8: note: declared here

Above are some warnings that cannot be worried about. The result is normal after modifing the demo.go file. Following are the modified statements.

Line 99: label.ModifyFontEasy("DejaVu Serif 15") ---> label.ModifyFontEasy("Consolas 15")

Line 266: tag := buffer.CreateTag("bold", map[string]string{ "background": "#FF0000", "weight": "700"}) ---> testTag := make(map[string]interface{}) tag := buffer.CreateTag("bold", testTag)