Code Yarns ‍👨‍💻
Tech BlogPersonal Blog

OpenGL functions not resolved in Eclipse

📅 2015-Oct-06 ⬩ ✍️ Ashwin Nanjappa ⬩ 🏷️ eclipse, eclipse cdt, opengl ⬩ 📚 Archive

Problem

In Eclipse, I am able to build and run C++ code that calls OpenGL functions. However, most of the OpenGL calls are marked as could not be resolved by the Indexer in Eclipse.

Solution

Almost all of the modern OpenGL functions are defined behind the GL_GLEXT_PROTOTYPES symbol in header files such as gl.h and glext.h. We need to define this symbol for the Indexer.

Go to project Properties -> C/C++ General -> Paths and Symbols. Under the Symbols tab, add a new symbol with the Name as GL_GLEXT_PROTOTYPES. No value needs to be provided. Rebuild the index for the project and the unresolved indications for OpenGL functions should be gone!

Tried with: Eclipse 4.5 and Ubuntu 14.04


© 2022 Ashwin Nanjappa • All writing under CC BY-SA license • 🐘 @codeyarns@hachyderm.io📧