3

I'm having a problem using Eclipse CDT, where it does not recognize some OpenGL functions. I have the header included from

/Developer/SDKs/MacOSX10.6.sdk/System/Library/Frameworks/OpenGL.framework/Headers

Some functions/enums are recognized by the indexer, some are not and provide no auto-completion. However if I command+click any of them (red or regular) I am taken to the proper file (GL.h) and the correct location of the function

I've checked, and those enums are indeed defined in that header.

enter image description here

Again compiles fine, but no code-completion provided, and areas are marked red as if wrong.

1dayitwillmake
  • 2,269
  • 3
  • 26
  • 35
  • Have you included all the required OpenGL header files in your project? I guess that since you are using the OpenGL immediate mode (that I advice you to not do it since it is deprecated) you should include the required header files something like this: #include #include #include In particular, I think the basic declaration of the GL_QUADS constants are into the file "gl.h" which is included into the declaration of the file "glu.h" – Maurizio Benedetti Jan 17 '12 at 16:21
  • This seems like a problem with Eclipse. Try recreating your project or cleaning it. – Oskar Jul 13 '12 at 10:12
  • Perhaps, your problem is related to [this](http://stackoverflow.com/questions/177569/why-does-eclipse-code-completion-not-work-on-some-projects) – Fabien R Sep 22 '12 at 10:46

1 Answers1

0

I get the same error quite often as well. Sometimes cutting the faulty line & pasting it back helps, but if that doesn't solve the issue a restart of Eclipse worked for me in all cases until now.

And the last resort solution to all Eclipse issue that cannot be resolved otherwise: Recreate the workspace and project, and copy only the source files into the new workspace. This has fixed most weird issues of Eclipse for many people, including myself.

Njol
  • 3,271
  • 17
  • 32