1

I'm trying to get Flycheck to correctly see where OpenGL is on my Mac, but it can't seem to find it. I've tried adding the following lines to my .clang_complete file, but nothing seems to work. I keep getting the error OpenGL/gl.h could not be found:

-framework OpenGL
-I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/OpenGL.framework/Headers

This doesn't happen during compilation, it's just messing up static analysis and compilation by Irony. The directory I listed has gl.h and glu.h in it directly, which is probably why it didn't help to add, but I can't figure out how to get Irony to see the files correctly.

Edit: Using Flycheck for syntax checking, not Irony

Edit: macOS X Framework directory:

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/
    OpenGL.framework/
        Headers/
        Modules/
        OpenGL.tbd/
        Versions/
HoldOffHunger
  • 18,769
  • 10
  • 104
  • 133
iHowell
  • 2,263
  • 1
  • 25
  • 49
  • I just checked on my linux box and it works fine - using `c/c++-clang` checker with zero configuration, using gl.h and glut.h, so I assume you''re correct it is a macOS issue. I also don't use the `-framework` argument – Rorschach Jul 22 '19 at 15:41
  • Yeah, but you have to use frameworks on OS X. That's how OpenGL is installed. I'll add an edit to show the framework directory in case that helps. – iHowell Jul 22 '19 at 17:19

1 Answers1

0

Well, since no one seems to have an answer on this, I'll post my workaround. By symlinking /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/OpenGL.framework/Headers to /usr/local/include/OpenGL, you can give the checker the file path it wants, fixing the issue. Not the best solution, but a decent workaround nonetheless.

iHowell
  • 2,263
  • 1
  • 25
  • 49