Skip to content

Fail build gtk.go with go1.3 #210

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

Closed
YouROK opened this issue Jun 25, 2014 · 5 comments
Closed

Fail build gtk.go with go1.3 #210

YouROK opened this issue Jun 25, 2014 · 5 comments

Comments

@YouROK
Copy link

YouROK commented Jun 25, 2014

fails on build gtk.go:
go get github.com/mattn/go-gtk/gtk

github.com/mattn/go-gtk/gtk

src/github.com/mattn/go-gtk/gtk/gtk.go:58: cannot use p.Bin.Container.Widget.GWidget (type *C.struct__GtkWidget) as type *C.GtkWidget in argument to _Cfunc_toGWindow
src/github.com/mattn/go-gtk/gtk/gtk.go:59: cannot use p.Window.Bin.Container.Widget.GWidget (type *C.struct__GtkWidget) as type *C.GtkWidget in argument to _Cfunc_toGDialog
src/github.com/mattn/go-gtk/gtk/gtk.go:60: cannot use p.Dialog.Window.Bin.Container.Widget.GWidget (type *C.struct__GtkWidget) as type *C.GtkWidget in argument to _Cfunc_toGAboutDialog
...
src/github.com/mattn/go-gtk/gtk/gtk.go:69: too many errors

in .go files, cgo struct defines as "type *C.struct__GtkWidget" and in C headers .h functions get args as "type *C.GtkWidget"
ret types have same bugs

in older version go, all build ok
sorry for my english

@silvasur
Copy link
Contributor

Really weird...

I pulled the latest version of go-gtk and tried to go install the gtk package and got similar errors:

$ cd ~/go/src/github.com/mattn/go-gtk/gtk
$ go install 
# github.com/mattn/go-gtk/gtk
./gtk.go:58: cannot use _Cfunc_toGWindow(p.Bin.Container.Widget.GWidget) (type *C.GtkWindow) as type *C.struct__GtkWindow in return argument
./gtk.go:1199: cannot use WINDOW(v) (type *C.struct__GtkWindow) as type *C.GtkWindow in argument to _Cfunc_gtk_window_set_title
./gtk.go:1205: cannot use WINDOW(v) (type *C.struct__GtkWindow) as type *C.GtkWindow in argument to _Cfunc_gtk_window_set_resizable
./gtk.go:1208: cannot use WINDOW(v) (type *C.struct__GtkWindow) as type *C.GtkWindow in argument to _Cfunc_gtk_window_get_resizable
./gtk.go:1211: cannot use WINDOW(v) (type *C.struct__GtkWindow) as type *C.GtkWindow in argument to _Cfunc_gtk_window_add_accel_group
./gtk.go:1219: cannot use WINDOW(v) (type *C.struct__GtkWindow) as type *C.GtkWindow in argument to _Cfunc_gtk_window_set_modal
./gtk.go:1222: cannot use WINDOW(v) (type *C.struct__GtkWindow) as type *C.GtkWindow in argument to _Cfunc_gtk_window_set_default_size
./gtk.go:1226: cannot use WINDOW(v) (type *C.struct__GtkWindow) as type *C.GtkWindow in argument to _Cfunc_gtk_window_set_gravity
./gtk.go:1233: cannot use WINDOW(v) (type *C.struct__GtkWindow) as type *C.GtkWindow in argument to _Cfunc_gtk_window_set_position
./gtk.go:1236: cannot use WINDOW(v) (type *C.struct__GtkWindow) as type *C.GtkWindow in argument to _Cfunc_gtk_window_set_transient_for
./gtk.go:1236: too many errors

Then I installed the package again with all dependencies (using go install ./... in the directory) and everything worked nicely.

Shouldn't the go tool do all this automatically? Weird!

@mattn
Copy link
Owner

mattn commented Jun 30, 2014

I know this. It seems cgo broken.

@YouROK
Copy link
Author

YouROK commented Jun 30, 2014

Thanks kch42, this is work.

@StefanCristian
Copy link

@kch42 if latest means 1.3 < 1.3.1, then this might be a similar issue: https://code.google.com/p/go/issues/detail?id=8463

@mattn
Copy link
Owner

mattn commented Aug 11, 2014

In latest go on hg, it should be worked.

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

4 participants