go-gl-legacy / gl

Go bindings for OpenGL
BSD 3-Clause "New" or "Revised" License
342 stars 52 forks source link

Doesn't build after opengl upgrade #99

Closed bytbox closed 11 years ago

bytbox commented 11 years ago

On archlinux:

# github.com/go-gl/gl
In file included from attriblocation.go:7:0:
gl.h:5:25: error: enumerator value for '__cgo_enum__5' is not an integer constant
 #define GLEW_GET_FUN(x) (*x)
                         ^
/usr/include/GL/glew.h:1895:36: note: in expansion of macro 'GLEW_GET_FUN'
 #define glDisableVertexAttribArray GLEW_GET_FUN(__glewDisableVertexAttribArray)
                                    ^
gl.h:5:25: error: enumerator value for '__cgo_enum__6' is not an integer constant
 #define GLEW_GET_FUN(x) (*x)
                         ^
/usr/include/GL/glew.h:1957:27: note: in expansion of macro 'GLEW_GET_FUN'
 #define glVertexAttrib3fv GLEW_GET_FUN(__glewVertexAttrib3fv)
                           ^
gl.h:5:25: error: enumerator value for '__cgo_enum__7' is not an integer constant
 #define GLEW_GET_FUN(x) (*x)
                         ^
/usr/include/GL/glew.h:1950:26: note: in expansion of macro 'GLEW_GET_FUN'
 #define glVertexAttrib2f GLEW_GET_FUN(__glewVertexAttrib2f)
                          ^
gl.h:5:25: error: enumerator value for '__cgo_enum__8' is not an integer constant
 #define GLEW_GET_FUN(x) (*x)
                         ^
/usr/include/GL/glew.h:1956:26: note: in expansion of macro 'GLEW_GET_FUN'
 #define glVertexAttrib3f GLEW_GET_FUN(__glewVertexAttrib3f)
                          ^
gl.h:5:25: error: enumerator value for '__cgo_enum__9' is not an integer constant
 #define GLEW_GET_FUN(x) (*x)
                         ^
/usr/include/GL/glew.h:1944:26: note: in expansion of macro 'GLEW_GET_FUN'
 #define glVertexAttrib1f GLEW_GET_FUN(__glewVertexAttrib1f)
                          ^
gl.h:5:25: error: enumerator value for '__cgo_enum__10' is not an integer constant
 #define GLEW_GET_FUN(x) (*x)
                         ^
/usr/include/GL/glew.h:1978:31: note: in expansion of macro 'GLEW_GET_FUN'
 #define glVertexAttribPointer GLEW_GET_FUN(__glewVertexAttribPointer)
                               ^
gl.h:5:25: error: enumerator value for '__cgo_enum__11' is not an integer constant
 #define GLEW_GET_FUN(x) (*x)
                         ^
/usr/include/GL/glew.h:1945:27: note: in expansion of macro 'GLEW_GET_FUN'
 #define glVertexAttrib1fv GLEW_GET_FUN(__glewVertexAttrib1fv)
                           ^
gl.h:5:25: error: enumerator value for '__cgo_enum__12' is not an integer constant
 #define GLEW_GET_FUN(x) (*x)
                         ^
/usr/include/GL/glew.h:1971:27: note: in expansion of macro 'GLEW_GET_FUN'
 #define glVertexAttrib4fv GLEW_GET_FUN(__glewVertexAttrib4fv)
                           ^
gl.h:5:25: error: enumerator value for '__cgo_enum__13' is not an integer constant
 #define GLEW_GET_FUN(x) (*x)
                         ^
/usr/include/GL/glew.h:1970:26: note: in expansion of macro 'GLEW_GET_FUN'
 #define glVertexAttrib4f GLEW_GET_FUN(__glewVertexAttrib4f)
                          ^
gl.h:5:25: error: enumerator value for '__cgo_enum__14' is not an integer constant
 #define GLEW_GET_FUN(x) (*x)
                         ^
/usr/include/GL/glew.h:1951:27: note: in expansion of macro 'GLEW_GET_FUN'
 #define glVertexAttrib2fv GLEW_GET_FUN(__glewVertexAttrib2fv)
                           ^
gl.h:5:25: error: enumerator value for '__cgo_enum__15' is not an integer constant
 #define GLEW_GET_FUN(x) (*x)
                         ^
/usr/include/GL/glew.h:1897:35: note: in expansion of macro 'GLEW_GET_FUN'
 #define glEnableVertexAttribArray GLEW_GET_FUN(__glewEnableVertexAttribArray)
                                   ^
attriblocation.go:42:2: error: initializer element is not constant
 func (indx AttribLocation) Attrib4fv(values *[4]float32) {
  ^
attriblocation.go:42:2: error: (near initialization for '__cgodebug_data[5]')
attriblocation.go:43:2: error: initializer element is not constant
  C.glVertexAttrib4fv(C.GLuint(indx), (*C.GLfloat)(&values[0]))
  ^
attriblocation.go:43:2: error: (near initialization for '__cgodebug_data[6]')
attriblocation.go:44:2: error: initializer element is not constant
 }
  ^
attriblocation.go:44:2: error: (near initialization for '__cgodebug_data[7]')
attriblocation.go:45:2: error: initializer element is not constant

  ^
attriblocation.go:45:2: error: (near initialization for '__cgodebug_data[8]')
attriblocation.go:46:2: error: initializer element is not constant
 func (indx AttribLocation) AttribPointer(size uint, typ GLenum, normalized bool, stride int, pointer interface{}) {
  ^
attriblocation.go:46:2: error: (near initialization for '__cgodebug_data[9]')
attriblocation.go:47:2: error: initializer element is not constant
  C.glVertexAttribPointer(C.GLuint(indx), C.GLint(size), C.GLenum(typ),
  ^
attriblocation.go:47:2: error: (near initialization for '__cgodebug_data[10]')
attriblocation.go:48:2: error: initializer element is not constant
   glBool(normalized), C.GLsizei(stride), ptr(pointer))
  ^
attriblocation.go:48:2: error: (near initialization for '__cgodebug_data[11]')
attriblocation.go:49:2: error: initializer element is not constant
 }
  ^
attriblocation.go:49:2: error: (near initialization for '__cgodebug_data[12]')
attriblocation.go:50:2: error: initializer element is not constant

  ^
attriblocation.go:50:2: error: (near initialization for '__cgodebug_data[13]')
attriblocation.go:51:2: error: initializer element is not constant
 func (indx AttribLocation) EnableArray() {
  ^
attriblocation.go:51:2: error: (near initialization for '__cgodebug_data[14]')
attriblocation.go:52:2: error: initializer element is not constant
  C.glEnableVertexAttribArray(C.GLuint(indx))
  ^
attriblocation.go:52:2: error: (near initialization for '__cgodebug_data[15]')
bytbox commented 11 years ago

(This is go 1.0.3.)

pwaller commented 11 years ago

Does it build if you comment out lines 4 and 5 of gl.h?

bytbox commented 11 years ago

Close, but no cigar.

# github.com/go-gl/gl
could not determine kind of name for C.glVertexAttrib4fv
could not determine kind of name for C.glVertexAttrib1f
could not determine kind of name for C.glVertexAttrib2fv
could not determine kind of name for C.glVertexAttribPointer
could not determine kind of name for C.glVertexAttrib1fv
could not determine kind of name for C.glVertexAttrib3f
could not determine kind of name for C.glVertexAttrib3fv
could not determine kind of name for C.glVertexAttrib4f
could not determine kind of name for C.glVertexAttrib2f
could not determine kind of name for C.glEnableVertexAttribArray
could not determine kind of name for C.glDisableVertexAttribArray
pwaller commented 11 years ago

What versions of glew and gl do you have installed on your system? Can you give the vitals of your archlinux install so that it might be possible to try and reproduce it?

bytbox commented 11 years ago

On Mon, 8 Apr 2013, Peter Waller wrote:

What versions of glew and gl do you have installed on your system? Can you give the vitals of your archlinux install so that it might be possible to try and reproduce it?

mesa 9.1.1 mesa-libgl 9.1.1 glew 1.9.0

Scott Lawrence

pwaller commented 11 years ago

@banthar, do you understand what's happening here?

pwaller commented 11 years ago

I figured it out. It's nothing to do with OpenGL. The problem stems from this go/gcc bug. I'm afraid we can't do anything from our side to fix this. Your only hope is to use go tip when they fix it, or stick to gcc < 4.8 for the time being.

I'm closing this one invalid from our side, but feel free to report back if there is more information or my analysis is incorrect (such as this being fixed upstream).

bytbox commented 11 years ago

Analysis makes sense to me (only looked at it briefly though). Thanks anyway.

On Thu, 11 Apr 2013, Peter Waller wrote:

I figured it out. It's nothing to do with OpenGL. The problem stems from this go/gcc bug. I'm afraid we can't do anything from our side to fix this. Your only hope is to use go tip when they fix it, or stick to gcc < 4.8 for the time being.

I'm closing this one invalid from our side, but feel free to report back if there is more information or my analysis is incorrect (such as this being fixed upstream).


Reply to this email directly or view it on GitHub: https://github.com/go-gl/gl/issues/99#issuecomment-16264695

Scott Lawrence