I just recently upgraded to El Captitan. After the upgrade, the OpenGL related headers, like <OpenGL/gl.h>
, can not be found. The problem does not exist before the upgrade. Anyone knows how to solve this problem?
Asked
Active
Viewed 64 times
1

user2621037
- 326
- 1
- 3
- 13
-
You'll probably need an Xcode update to get the matching platform SDK for the new OS. – Reto Koradi Oct 04 '15 at 17:50
-
I also upgraded XCode to version 7.0 (7A220) – user2621037 Oct 04 '15 at 18:23
-
I found the OpenGL headers can be found with XCode. I am using QtCreator as the IDE and g++-mp-4.8 instaledl with MacPorts as the compiler. – user2621037 Oct 04 '15 at 18:40
-
I don't know where those tools/environments look for the OpenGL headers. My answer here explains where the headers are: http://stackoverflow.com/questions/2197223/where-are-the-opengl-header-files-located-on-macosx/23576954#23576954. – Reto Koradi Oct 04 '15 at 18:48
1 Answers
0
I found the problem is because the Mac SDK version is not correctly set in Qt after system upgrade. One can follow the asnswer in this post to change the mac os version to correct one.
But there is still one problem remaining, the compiler is not able to find the OpenGL framework when linking the executables. I found it is because the linker option -Wl,-syslibroot,/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk
, which is automatically added by qmake. If I manually type it the linking command without the option, then it works. I haven't found out how to solve this problem yet.

Community
- 1
- 1

user2621037
- 326
- 1
- 3
- 13