2011-12-22 1 views
2

私は最初にgl3w.cをgccでビルドしてから、自分のOGLGraphics.cppというファイルをg ++でビルドするプロジェクトを持っています。それはC++からのCファイルで動作しますが、なぜないC++ファイルからのgl3wエラー

In file included from /mnt/hgfs/grace/src/grace-output/graphics/OGLGraphics.cpp:22:0: 
/mnt/hgfs/grace/src/grace-output/include/GL3/gl3w.h:69:8: error: ‘PFNGLDRAWARRAYSPROC’ does not name a type 
/mnt/hgfs/grace/src/grace-output/include/GL3/gl3w.h:70:8: error: ‘PFNGLDRAWELEMENTSPROC’ does not name a type 
/mnt/hgfs/grace/src/grace-output/include/GL3/gl3w.h:71:8: error: ‘PFNGLGETPOINTERVPROC’ does not name a type 
/mnt/hgfs/grace/src/grace-output/include/GL3/gl3w.h:72:8: error: ‘PFNGLPOLYGONOFFSETPROC’ does not name a type 
/mnt/hgfs/grace/src/grace-output/include/GL3/gl3w.h:73:8: error: ‘PFNGLCOPYTEXIMAGE1DPROC’ does not name a type 
/mnt/hgfs/grace/src/grace-output/include/GL3/gl3w.h:74:8: error: ‘PFNGLCOPYTEXIMAGE2DPROC’ does not name a type 
/mnt/hgfs/grace/src/grace-output/include/GL3/gl3w.h:75:8: error: ‘PFNGLCOPYTEXSUBIMAGE1DPROC’ does not name a type 
/mnt/hgfs/grace/src/grace-output/include/GL3/gl3w.h:76:8: error: ‘PFNGLCOPYTEXSUBIMAGE2DPROC’ does not name a type 
/mnt/hgfs/grace/src/grace-output/include/GL3/gl3w.h:77:8: error: ‘PFNGLTEXSUBIMAGE1DPROC’ does not name a type 
/mnt/hgfs/grace/src/grace-output/include/GL3/gl3w.h:78:8: error: ‘PFNGLTEXSUBIMAGE2DPROC’ does not name a type 
/mnt/hgfs/grace/src/grace-output/include/GL3/gl3w.h:79:8: error: ‘PFNGLBINDTEXTUREPROC’ does not name a type 
/mnt/hgfs/grace/src/grace-output/include/GL3/gl3w.h:80:8: error: ‘PFNGLDELETETEXTURESPROC’ does not name a type 
/mnt/hgfs/grace/src/grace-output/include/GL3/gl3w.h:81:8: error: ‘PFNGLGENTEXTURESPROC’ does not name a type 
/mnt/hgfs/grace/src/grace-output/include/GL3/gl3w.h:82:8: error: ‘PFNGLISTEXTUREPROC’ does not name a type 

私は知らない。私はこれらのエラーを取得gl3w.hを含むファイルをコンパイルしようとする++ gがときGCCは成功しgl3w.cをコンパイルしますが?

答えて

6

GL3Wのreadmeファイルに記載されている手順に従っていますか?具体的には、OpenGLファイルの前に、gl3w.h最初のを含む部分。

ああ、window.hの前には、gl.hを含めることができます。

+0

gl3wの前にglfwを含めました。ありがとう! – grivescorbett

0

このエラーは、GLTriangleBatch.hなどのコードに#include <OpenGL/gl.h>が含まれていることが原因です。 #include "GL/gl3w.h"の代わりにOpenGL 3/4呼び出しを使用すると、エラーが取り除かれます。異なるバージョンのOpenGL呼び出し間で競合が発生していると考えられます。 SB6にSuperBible 5コードを移植しようとしていたときに、この同じ問題が発生しました。

関連する問題