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
}
cgo-gcc-prolog:36:10: error: field has incomplete type 'GLvoid' (aka 'void')
void glGenVertexArrays(
GLsizei n, GLuint *arrays)
; -->on darwin amd64 openglGLvoid glGenVertexArraysOES(GLsizei n, GLuint *arrays) -->on darwin arm opengles
package main
/*
#include <stdlib.h>
#include <stdio.h>
typedef void GLvoid;
GLvoid Foo() {
printf("foo");
}
*/
import "C"
func main() {
C.Foo()
}
cgo-gcc-prolog:34:10: error: field has incomplete type 'GLvoid' (aka 'void')
在 2017年4月26日星期三 UTC+8下午3:20:14,hui zhang写道:gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 8.0.0 (clang-800.0.42.1)
Target: x86_64-apple-darwin15.5.0
Thread model: posix