Skip to content

cmd/cgo: GLEW fails to build on go tip (cannot parse GCC4.8 track-macro-expansion output) #5153

@gopherbot

Description

@gopherbot

by qeed.quan:

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.

Attachments:

  1. gl.zip (6539 bytes)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions