Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse marks OpenGL functions cannot be resolved

I tried making use of some OpenGL-functions in Eclipse C/C++. some "standard" functions as GlClear are recognized by eclipse, others like glBindBuffer() and glEnableVertexAttribArray() aren't. They are just underlined in red.

However compilation is succesful, there's just this disturbing underlining..

I have linked glut, GL, GLU and GLEW and my operating system is arch linux. I use eclipse 3.7.2

What do I have to do additionally to avoid these errors?

like image 664
codor Avatar asked May 02 '12 19:05

codor


2 Answers

Try right-click your project and in the popup menu: Index > Rebuild

like image 104
echeij Avatar answered Nov 10 '22 10:11

echeij


Underlining means C++ Indexer doesn't recognise a symbol. Check if this helps:

How can I get Eclipse to index code inside #ifdef .... #endif

In order to use OpenGL 2.0 functions I had defined GL_GLEXT_PROTOTYPES symbol in the source file, but the Indexer wasn't picking it up. It had to be defined in project settings, under: Project Properties > C/C++ General > Paths & Symbols. Then after rebuilding the index the errors disappeared.

like image 28
YRH Avatar answered Nov 10 '22 08:11

YRH