Goプログラム内からOpenGLを使用しようとしています。私はだと思っています。私はすべての作品を用意していますが、まだそれを動かすことはできません。GoからOpenGLを使用する
私のCコンパイラはの変数にあり、cgo
のドキュメントの乱数の例で動作することを確認しました。
mingw-w64のインストールで、bin、lib、およびincludeフォルダを\mingw\x86_64-w64-mingw32
相当にコピーして、64ビットGLEW 1.9.0をインストールしました。私がしようとgo get 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)
^
d:\programs\mingw64\x86_64-w64-mingw32\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__6' is not an integer constant
#define GLEW_GET_FUN(x) (*x)
これらのエラーは__cgo_enum__15
までの値について、同様の方法で続けます。私はまた、いくつかの一致エラーは、各エントリのものの行く側から来る得る。
これを機能させるために私が紛失していることに関するアイデアはありますか?
編集:ここでは、物事のGo側からの '一致する'ログがあります。
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
}
__cgodebug_data[]
5-15に1つあります。
編集2:ログを添付するように求められました。 Here is what happens when I compile with GCC 4.8およびHere is what I get with 4.7 and 4.6。
マッチングエラーはどういう意味ですか?あなたもそれらを投稿できますか? – nemo
私は家のゴーサイドから来たようなエラーを追加しました。 –
'$ GOROOT/src/pkg/github.com/go-gl/gl'で' go build -a -x'を実行して、既に投稿したエラーメッセージに加えて失敗した行を貼り付けてください。これらは役に立ちます。 – nemo