You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For some reason I am getting a build error using cgo with GLEW, I am running linux 64
bit version and
go version devel +811f060da18a Thu Mar 28 15:04:25 2013 -0700 linux/amd64
with GCC 4.8
I get build errors such as these when trying to install GLEW
# gl
In file included from buffer.go:4:0:
gl.h:4:25: error: enumerator value for '__cgo_enum__8' is not an integer constant
#define GLEW_GET_FUN(x) (*x)
^
/usr/include/GL/glew.h:1685:22: note: in expansion of macro 'GLEW_GET_FUN'
#define glGenBuffers GLEW_GET_FUN(__glewGenBuffers)
^
gl.h:4:25: error: enumerator value for '__cgo_enum__9' is not an integer constant
#define GLEW_GET_FUN(x) (*x)
^
/usr/include/GL/glew.h:1679:22: note: in expansion of macro 'GLEW_GET_FUN'
#define glBindBuffer GLEW_GET_FUN(__glewBindBuffer)
^
gl.h:4:25: error: enumerator value for '__cgo_enum__10' is not an integer constant
#define GLEW_GET_FUN(x) (*x)
^
the errors continue from here but they are mostly the same.
The GLEW header file does
#define GLEW_GET_FUN(x) (x)
but it needed
#define GLEW_GET_FUN(x) (*x)
to compile properly when cgo was still working, or else one would get the error:
could not determine kind of name for C.glDeleteBuffers
and so on.
I have attached my GL bindings to test with glew.
I don't have GCC 4.7 to test, but I assume yes. I tested it today with clang (CC=clang
go install gl) and it works, I am using clang version 3.2 (tags/RELEASE_32/final)
GCC 4.8 macro expansion tracking modifies the output. cgo parses the output of GCC on a
specially crafted file to classify identifiers.
See issue #5118 for a workaround to disable the macro expansion tracking.
by qeed.quan:
Attachments:
The text was updated successfully, but these errors were encountered: