andrés
andrés

Reputation: 412

"OpenGL.h not found" when building GLV on OS X?

I'm trying to build glv on mac os x. I'm new to this operating system and I can't find the error. The conflicting command is:

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

output

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

this is the file that contains the line that triggers the error: https://svn.mat.ucsb.edu/svn/glv-svn/trunk/GLV/glv_conf.h

I'm running mac os x 10.7.3.

If i run 'locate OpenGL.h' I get:

/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 

Upvotes: 0

Views: 1806

Answers (2)

andrés
andrés

Reputation: 412

Actually there were two errors. The first one was that i was missing the '-c' flag (this file did not need to be linked as it was part of a library). After adding this flag I removed the -isysroot and -arch options and everything worked.

Upvotes: 0

Ken Thomases
Ken Thomases

Reputation: 90551

Add -framework OpenGL to the build command.

Upvotes: 3

Related Questions