I simply the case as below , how to fix it? package main
/* #include <stdlib.h> #include <stdio.h> typedef void GLvoid; GLvoid Foo() { printf("foo"); } */ import "C" func main() { C.Foo() } go build void.go cgo-gcc-prolog:34:10: error: field has incomplete type 'GLvoid' (aka 'void') 在 2017年4月26日星期三 UTC+8下午3:20:14,hui zhang写道: > > Check code below > go call c opengl/opengles code, typedef void GLvoid > > func GenVertexArrays(n int32, arrays *uint32) { > //C.glGenVertexArrays((C.GLsizei)(n), (*C.GLuint)(unsafe.Pointer(arrays))) > --> ok on darwin amd64 > C.glGenVertexArraysOES((C.GLsizei)(n), > (*C.GLuint)(unsafe.Pointer(arrays))) --> fail on darwin arm > } > > Error Message > > cgo-gcc-prolog:36:10: error: field has incomplete type 'GLvoid' (aka > 'void') > For the GLvoid(aka void) can not be understood by cgo > > function decalred > void *glGenVertexArrays*(GLsizei n, GLuint *arrays); -->on darwin amd64 > opengl > > GLvoid glGenVertexArraysOES(GLsizei n, GLuint *arrays) -->on darwin arm > opengles > > > > > > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.