Windows Cgo Glew undefined reference

237 views
Skip to first unread message

Mathews

unread,
Nov 17, 2012, 6:51:39 PM11/17/12
to golan...@googlegroups.com
Hi,

i'm trying to use opengl with go.
Therefore i tried Banthar-Opengl: https://github.com/banthar/gl
While on Linux everything works fine, i have troubles making it work
on windows.
Running a "go install" on the packages yields many of those:
C:\SOME\PATH\banthar\gl\_obj\gl.cgo2.o: In function `_cgo_f94b1c8c2048_Cfunc_glActiveTexture':
./gl.go:58: undefined reference to `__imp___glewActiveTexture'

Usually i would say, that the glew32.lib isn't linked, however in gl.gol it says:
// #cgo windows LDFLAGS: -lglew32 -lopengl32

I'm using Win7_64 with mingw-w64.
The 64bit Glew is installed.

Any ideas what is causing the problem or how to fix it?

minux

unread,
Nov 18, 2012, 2:34:02 AM11/18/12
to Mathews, golan...@googlegroups.com
make sure you can compile a C program that calls opengl and glew function 
with the LDFLAGS "-lglew32 -lopengl32".

cgo doesn't need the xxx.lib file, it only needs to find the xxx.dll file.

Mathews

unread,
Nov 18, 2012, 5:38:01 AM11/18/12
to golan...@googlegroups.com, Mathews
Ahh, thank you, found the mistake - the binaries from glew are only for
Visual-Studio.
Had to compile the glew-source with mingw.
Anyone stumbling across the same problem, this thread may help, if you
don't want to install cygwin or the like to run the makefile.
Reply all
Reply to author
Forward
0 new messages