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

Doesn't build undir Windows using mingw32 #1

Open
markokocic opened this issue Nov 12, 2010 · 5 comments
Open

Doesn't build undir Windows using mingw32 #1

markokocic opened this issue Nov 12, 2010 · 5 comments

Comments

@markokocic
Copy link

Hi, I succeeded building go-fltk and examples on windows box by slightly tweaking the makefile, but when I try to run examle I get the following panic error.

c:\development\cvstree\go-fltk\examples>hello
throw: cgocall unavailable

panic PC=0x83a07c
runtime.throw+0x47 /go/src/pkg/runtime/runtime.c:76
        runtime.throw(0x4de170, 0x0)
runtime.cgocall+0x32 /go/src/pkg/runtime/cgocall.c:19
        runtime.cgocall(0x0, 0x83a0b4, 0x0)
fltk._Cfunc_go_fltk_get_UP_BOX+0x32 /development/cvstree/go-fltk/_cgo_defun.c:127
        fltk._Cfunc_go_fltk_get_UP_BOX(0x0, 0x0)
fltk.init┬╖1+0x1e c:/development/cvstree/go-fltk/fltk.cgo1.go:-58
        fltk.init┬╖1()
fltk.Init┬╖+0x50 c:/development/cvstree/go-fltk/fltk.cgo1.go:169
        fltk.Init┬╖()
main.init+0x46 c:/development/cvstree/go-fltk/examples/hello.go:16
        main.init()
runtime.mainstart+0x5 386/asm.s:82
        runtime.mainstart()
runtime.goexit /go/src/pkg/runtime/proc.c:146
        runtime.goexit()

I suppose the problem is that something is not compiled or linked as it should?

Here are my modifications to makefiles:

diff --git a/Makefile b/Makefile
index 6b4f159..c1d2753 100644
--- a/Makefile
+++ b/Makefile
@@ -23,7 +23,7 @@ CGOFILES=
window.go
CGO_DEPS=fltk.o

-CGO_LDFLAGS=fltk.o $(FLTK_LIB) -lXext -lXinerama -lXft -lX11 -lXi -lm
+CGO_LDFLAGS=fltk.o $(FLTK_LIB) -lm -lpthread -lmsimg32 -lole32 -luuid -lcomctl32 -lwsock32 -lgdi32

 include $(GOROOT)/src/Make.pkg

@@ -44,7 +44,7 @@ $(FLTK)/stamp: $(FLTK_DIST)
    touch $(FLTK)/stamp

 $(FLTK_DIST):
-   (cd /tmp; wget $(FLTK_URL))
+   (cd /tmp; curl -C - -O $(FLTK_URL))

 clean-fltk:
    rm -rf $(FLTK)
diff --git a/examples/Makefile b/examples/Makefile
index b70a4f1..7ef6e8b 100644
--- a/examples/Makefile
+++ b/examples/Makefile
@@ -4,7 +4,7 @@ pkgdir=$(GOROOT)/pkg/$(GOOS)_$(GOARCH)
 all: $(BINS)

 text hello : % : %.go $(pkgdir)/cgo_fltk.so $(pkgdir)/fltk.a
-   8g $@.go && 8l -o $@ $@.8
+   8g $@.go && 8l -o $@.exe $@.8

 clean:
    rm -f $(BINS) *.8
@zot
Copy link
Owner

zot commented Nov 17, 2010

Sorry -- I didn't see this comment; it was buried under a huge torrent of email.

This thread seems to say that cgo isn't really supported on windows, yet:
http://groups.google.com/group/golang-nuts/browse_thread/thread/7c11f1049d2b556a

I'll ping the go list and see what they say.

@zot
Copy link
Owner

zot commented Nov 17, 2010

Here's the thread where I asked about it: http://groups.google.com/group/golang-nuts/browse_thread/thread/6018fafc0c9cbee2#

@zot
Copy link
Owner

zot commented Nov 17, 2010

Apparently cgo is still only experimental on windows and doesn't totally work, yet. I hope it does soon!

@zot
Copy link
Owner

zot commented Nov 18, 2010

Wei Guangjing replied to my thread with some advice that may solve the problem:

http://groups.google.com/group/golang-nuts/msg/23ef437bf5ed1d49

Hope this helps -- I'm very interested in seeing this work on Windows!

@markokocic
Copy link
Author

Thanks. I'll have to wait for another Go release to try this, since I was not able to build Go under Windows yet.

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