Jump to content
  • Advertisement
Sign in to follow this  
Lolums

OpenGL <OpenGL/gl.h> Include Failing

This topic is 866 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I've installed XCode and opened it once.
The command-line tools are also installed.

The linker flag `-framework OpenGL` is present under `Additional options` in the linker settings.

Under `Additional Library Directories` in the linker settings, I have added `/System/Library/Frameworks`.

The linker and C++ compiler are `g++`. The C compiler is `gcc`.

My OS X version is 10.11 (El Capitan).

I have included the headers below.

    #include <OpenGL/gl.h>
    #include <OpenGL/glu.h>

 However, the headers still do not resolve.

 

If I do the same for SDL2, <SDL2/sdl.h> DOES resolve but <SDL2/SDL_opengl.h> has an unresolved include in it, which is <OpenGL/gl.h>

Share this post


Link to post
Share on other sites
Advertisement

It is not exactly clear to me what build system you are using. It is Xcode itself? If yes, then adding "/System/Library/Frameworks/" should not be needed.

 

However, the frameworks therein are runtime components. The headers are development components - the are not bundled with the runtime components. Instead, they are bundled with the SDKs. For example, the SDK for Mac OS X 10.9 brings such headers

 

Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/OpenGL.framework/Versions/A/Headers/gl.h

Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/OpenGL.framework/Versions/A/Headers/gl3.h

Share this post


Link to post
Share on other sites

It is not exactly clear to me what build system you are using. It is Xcode itself? If yes, then adding "/System/Library/Frameworks/" should not be needed.

 

However, the frameworks therein are runtime components. The headers are development components - the are not bundled with the runtime components. Instead, they are bundled with the SDKs. For example, the SDK for Mac OS X 10.9 brings such headers

 

Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/OpenGL.framework/Versions/A/Headers/gl.h

Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/OpenGL.framework/Versions/A/Headers/gl3.h

 

Oh, I managed to forget the most important detail.

 

I'm using Netbeans 8.1 (C++), with the g++/gcc linkers/compilers.

 

Should I add that path instead?

Edit: searched for OpenGL.framework inside the XCode package and it doesn't exist

Edited by Lolums

Share this post


Link to post
Share on other sites
Unless you are working on a very old GPU or onboard GPU then you are not recommendet to use the GL headers rather than using some wrapper Library (GLFW) or writing your own one because in every profile from 3.2 and above you are binding for extension functions and use just a few build in ones you could directly link to. You also might need to set config in SDL correctly if there are unresolved errors with the right platform tag (that might not be set by default in your compiling unit)

Share this post


Link to post
Share on other sites

 

Edit: searched for OpenGL.framework inside the XCode package and it doesn't exist

 

Do you have any SDK installed?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!