2011-12-22 6 views
2

나는 처음에 gcc로 gl3w.c을 빌드 한 다음 g ++로 내 OGLGraphics.cpp 파일을 빌드하는 프로젝트를 가지고 있습니다. GCC가 성공적으로 gl3w.c 컴파일하지만 때 gl3w.h가 포함 된 파일 나는 이러한 오류를 얻을 컴파일을 시도 ++ g :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 

는 C++에서 C 파일과 함께 작동하지만 내가 왜 몰라?

답변

6

GL3W의 readme 파일에 나와있는 절차를 수행 했습니까? 특히, OpenGL 파일보다 먼저 gl3w.h첫 번째을 포함하는 부분입니다.

아, 그리고 window.h 앞에는 gl.h을 포함 할 수 있습니다.

+0

그래, gl3w 전에 glfw를 포함 시켰습니다. 감사합니다! – grivescorbett

0

이 오류는 #include <OpenGL/gl.h>이 GLTriangleBatch.h와 같은 코드에 포함되어 있기 때문에 발생합니다. #include "GL/gl3w.h"대신 OpenGL 3/4 호출을 사용하면 오류가 제거됩니다. OpenGL 호출의 다른 버전간에 충돌이 발생하여 알 수없는 형식 오류가 발생합니다 SB6에 SuperBible 5 코드를 포팅하려고 할 때도 이와 동일한 문제가 발생했습니다.

관련 문제