CND problem with code-completion

Hi,

First of all I don't really know where to put this post about C++ Pack in NetBeans. I've read one post in which someone suggests that this section will be pretty close...

Maybe someone here would be so kind and try to help me...

I'm using Ubuntu 7.04 and I have a problem with code completion in NetBeans 5.5.1 CND and I'm a little bit frustrated right now....

I installed Netbeans, then CND, Created new C++ Project. Added new source file, with #include <GL/glut.h> directive.

Whole code was compiled without errors, and that's fine.

There were some problems with linking but I've added "glut", "GL", "GLU" string to linker parameters in Project Properties.

The main problem is the code assistant. When I'm hitting "glut" and press ctrl+space it shows functions from glut library but when I type "gl" (to type "glColor3ub...") and try to show the code completion pop-up it shows "No suggestions". The same thing is with GLU library.

I've installed GL, GLU, glut libraries (they all sit calmly in /usr/include/GL).

I've added the /usr/include and /usr/include/GL to C++ section.

I think that the Netbeans is able to find those *.h files because, as I said before, the glut (and the glX) functions are shown properly but there is no sign of "gl" and "glu" FUNCTIONS in code completion (the #define values specified in gl.h and glu.h are on the list, but the functions aren't)...

I don't have idea why glut and glX are working fine, and gl and glu aren't... If anyone have similar problem, know where to look for an answer or have some suggestions I would be much obliged...

I've seen Eclipse CDT, Anjuta, kDevelop, Code::Blocks, VIM + icomplete... after checking them all there is only one decision - I want to use NetBeans CND. It's user-friendly, fast and I just like it. That's why I would really like to know why the code-completion isn't working in 100%...

[1965 byte] By [Makulaa] at [2007-11-27 8:48:04]
# 1
Maybe gl and glu functions are under some #ifdef -- if this is the case, you can add predefined macro to Parser configuration in Project properties dialog. If it's not the case, you can file a bug against cnd (see cnd.netbeans.org)
MaximKartasheva at 2007-7-12 20:54:22 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 2
Hi,The NetBeans C++ pack alias is users@cnd.netbeans.org.I need a bit more information to help you. Did you #include the file the glColor3ub function declaration reside? As far as i understand, there is no such function in glut.h...
Vladimir_Kvashina at 2007-7-12 20:54:22 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 3

Vladimir,

The glColor3ub function declaration is in gl.h file (which along with glu.h is included in glut.h).

Thanks Maxim,

In the matter of fact since yesterday I've been looking for the reason why the GL and GLU aren't indexed properly by the Netbeans CC and I've found something.

The GLU library was indexed after deleting

[code]

#include <GL/gl.h>

[/code]

directive. So it means that the gl.h library is messing up.

I've checked whole file (gl.h) and noticed that the only part which is in conflict with NetBeans is this one:

[code]

#elif defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 303

# define GLAPI __attribute__((visibility("default")))

# define GLAPIENTRY

[/code]

I'm using GCC 4.1 so the expression value is 401, so the GLAPI define looks like the line above.

gl.h is indexed properly by NetBeans when it is representing "extern", so it should look like

[code]

# define GLAPI extern

[/code]

It is working fine if you delete this part of gl.h or for example (which I've done) add predefined macro (or change the existing one)

[code]

__GNUC_MINOR__=-200

[/code]

I know that it isn't very clean solution... I'm not happy with cheating NetBeans about the version of installed GCC but unfortunately I am not a specialist in GNU C so maybe someone would find more elegant solution.

As far as I know the __attribute__ feature makes the GCC more verbose (warnings, errors) but I don't know how much functionality am I loosing in fact...

Edit: Why the code tags aren't working? :/

Message was edited by:

Makula

Makulaa at 2007-7-12 20:54:22 > top of Java-index,Development Tools,Solaris and Linux Development Tools...