I posted a bug error of this but as I see it sink down on the list I think it just may be something that can be solved simply.
I do OpenGL Programming and use GLFW. The glfw.h file includes both gl.h and glu.h, but in the recent builds code completion isn't looking beyond the immediate include file for functions. If I start typing glu... nothing will come up, and if I start typing gl... code completion only returns glfw functions. How come it is not looking at includes within includes. is there a setting to change this?
Quote from: indigo0086 on September 04, 2007, 02:32:21 PM
is there a setting to change this?
Possibly you need to adjust the C++ parser options (project options -> tab C++ parser) to include the path to the GL files.
With regards, Morten.
Still not working. I have the glfw libraries and headers in my mingw lib and include/GL directories respectively and I have mingw/include, and mingw/lib in my project options under search directories and libraries and still am getting the same problem.
[attachment deleted by admin]
Quote from: indigo0086 on September 05, 2007, 02:37:03 PM
Still not working. I have the glfw libraries and headers in my mingw lib and include/GL directories respectively and I have mingw/include, and mingw/lib in my project options under search directories and libraries and still am getting the same problem.
What happens if you include them anyway before the glfw header include? (Don't forget to save the file to have CC re-parsing.)
Quote from: MortenMacFly on September 05, 2007, 02:46:06 PM
What happens if you include them anyway before the glfw header include? (Don't forget to save the file to have CC re-parsing.)
It works for me if I include the header files exactly like this:
#include "GL/gl.h"
#include "GL/glu.h"
#include "GL/glfw.h"
That works of course, but the thing is, that's not how it used to work. Here's a snippet of code from the glfw header
// -------------------- END SYSTEM/COMPILER SPECIFIC ---------------------
// Include standard OpenGL headers: GLFW uses GL_FALSE/GL_TRUE, and it is
// convenient for the user to only have to include <GL/glfw.h>. This also
// solves the problem with Windows <GL/gl.h> and <GL/glu.h> needing some
// special defines which normally requires the user to include <windows.h>
// (which is not a nice solution for portable programs).
#if defined(__APPLE_CC__)
#include <OpenGL/gl.h>
#include <OpenGL/glu.h>
#else
#include <GL/gl.h>
#include <GL/glu.h>
#endif
Shouldn't the CC look into the header and see the included files and parse them appropriately? I am saying it worked before, but recently I noticed it does not. I put it up as a big but could hardly explain it as I can here.
I think the thing is that "" and <> are different paths, aren't they?
First one is for absolute paths within you project dir and secondone is for searchpath. Or am I wrong?
Quote from: Keyla on September 06, 2007, 07:48:44 PM
Or am I wrong?
No, it also works for me with <>. The reason is another, most likely related to the
#define wrapper which cannot be resolved at that point so CC skips this section.
With regards, Morten.
Ok, I just modified the glfw header file to comment out the entire header and just put them all local, no sense bothering I guess, but the block was the main problem.
Just as a reference to those interested (and not willing to dig through our svn changelog or code):
#if defined(__APPLE_CC__)
#include <OpenGL/gl.h>
#include <OpenGL/glu.h>
#else
#include <GL/gl.h>
#include <GL/glu.h>
#endif
The C++ parser in these cases always follows the code inside #if/ifdef/ifndef and skips the #else part. A special case to be considered later is "#if 0" which will force the parser to follow the #else branch instead.