go get error #100

Closed
hoperuin opened this Issue Apr 21, 2012 · 4 comments

Comments

Projects
None yet
5 participants
@hoperuin

github.com/mattn/go-gtk/gdk

gdk_windows.go:10[C:\Users\deadbaby\AppData\Local\Temp\go-build010955682\github.
com\mattn\go-gtk\gdk_obj\gdk_windows.cgo1.go:9]: undefined: unsafe
gdk_windows.go:10[C:\Users\deadbaby\AppData\Local\Temp\go-build010955682\github.
com\mattn\go-gtk\gdk_obj\gdk_windows.cgo1.go:9]: cannot convert _Cfunc_gdk_win3
2_drawable_get_handle(()(unsafe.Pointer(v.Window))) (type _Ctype_HGDIOBJ) to
type int32

@kierdavis

This comment has been minimized.

Show comment Hide comment
@kierdavis

kierdavis Apr 21, 2012

A temporary fix for the first error is to open \src\github.com\mattn\go-gtk\gdk\gdk_windows.go in a text editor and after the 'import "C"' line, add 'import "unsafe"'. Sadly, I don't know the cause of the second one - wait for the package developer to get back to you on that.

A temporary fix for the first error is to open \src\github.com\mattn\go-gtk\gdk\gdk_windows.go in a text editor and after the 'import "C"' line, add 'import "unsafe"'. Sadly, I don't know the cause of the second one - wait for the package developer to get back to you on that.

@edwardxie

This comment has been minimized.

Show comment Hide comment
@edwardxie

edwardxie Apr 22, 2012

Second error is type convert problem, editor src\github.com\mattn\go-gtk\gdk\gdk_windows.go
import ("fmt","strconv","unsafe")
func (v _GdkWindow) GetNativeWindowID() int32 {
h := fmt.Sprint(C.gdk_win32_drawable_get_handle((_C.GdkDrawable)(unsafe.Pointer(v.Window))))
i, _:= strconv.ParseInt(h,10,32)
return int32(i)
}

Second error is type convert problem, editor src\github.com\mattn\go-gtk\gdk\gdk_windows.go
import ("fmt","strconv","unsafe")
func (v _GdkWindow) GetNativeWindowID() int32 {
h := fmt.Sprint(C.gdk_win32_drawable_get_handle((_C.GdkDrawable)(unsafe.Pointer(v.Window))))
i, _:= strconv.ParseInt(h,10,32)
return int32(i)
}

@harrydb

This comment has been minimized.

Show comment Hide comment
@harrydb

harrydb Apr 23, 2012

github.com/mattn/go-gtk/gdk/gdk_linux.go needs import "unsafe" as well.

harrydb commented Apr 23, 2012

github.com/mattn/go-gtk/gdk/gdk_linux.go needs import "unsafe" as well.

@mattn

This comment has been minimized.

Show comment Hide comment
@mattn

mattn Dec 25, 2014

Owner

Probably, should be fixed in latest.

Owner

mattn commented Dec 25, 2014

Probably, should be fixed in latest.

@mattn mattn closed this Dec 25, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment