在OS X上构建GLV时“找不到OpenGL.h”?

时间:2012-04-07 01:36:29

标签: macos opengl

我正在尝试在mac os x上构建glv。我是这个操作系统的新手,我找不到错误。冲突的命令是:

c++ -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.7.sdk -stdlib=libc++ -I/usr/include -IGLV  src/glv_buttons.cpp

输出

clang: warning: argument unused during compilation: '-fpeel-loops'
In file included from src/glv_buttons.cpp:4:
In file included from GLV/glv_buttons.h:7:
In file included from GLV/glv_core.h:13:
In file included from GLV/glv_draw.h:9:
GLV/glv_conf.h:72:11: fatal error: 'OpenGL/OpenGL.h' file not found

这是包含触发错误的行的文件:https://svn.mat.ucsb.edu/svn/glv-svn/trunk/GLV/glv_conf.h

我正在运行mac os x 10.7.3。

如果我运行'locate OpenGL.h',我会得到:

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.6.sdk/System/Library/Frameworks/AppKit.framework/Versions/C/Headers/NSOpenGL.h
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.6.sdk/System/Library/Frameworks/OpenGL.framework/Versions/A/Headers/OpenGL.h
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/System/Library/Frameworks/AppKit.framework/Versions/C/Headers/NSOpenGL.h
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/System/Library/Frameworks/OpenGL.framework/Versions/A/Headers/OpenGL.h
/System/Library/Frameworks/AppKit.framework/Versions/C/Headers/NSOpenGL.h
/System/Library/Frameworks/OpenGL.framework/Versions/A/Headers/OpenGL.h 

2 个答案:

答案 0 :(得分:3)

-framework OpenGL添加到构建命令。

答案 1 :(得分:0)

实际上有两个错误。第一个是我错过了'-c'标志(这个文件不需要链接,因为它是库的一部分)。添加此标志后,我删除了-isysroot和-arch选项,一切正常。