Error Glui in linux

Hello. I made a program and now i want to add a glui menu, but whenever i try to compiles it i have these “mistakes”:

/usr/include/glui.h:34: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘Arcball’
/usr/include/glui.h:47: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘RGBc’
/usr/include/glui.h:188: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘GLUI_String’
/usr/include/glui.h:211: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘GLUI’
/usr/include/glui.h:212: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘GLUI_Control’
/usr/include/glui.h:213: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘GLUI_Listbox’
/usr/include/glui.h:214: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘GLUI_Rotation’
/usr/include/glui.h:215: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘GLUI_Translation’
/usr/include/glui.h:216: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘GLUI_Mouse_Interaction’
/usr/include/glui.h:217: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘GLUI_Checkbox’
/usr/include/glui.h:218: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘GLUI_Slider’
/usr/include/glui.h:219: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘GLUI_Button’
/usr/include/glui.h:220: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘GLUI_StaticText’
/usr/include/glui.h:221: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘GLUI_Bitmap’
/usr/include/glui.h:222: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘GLUI_EditText’
/usr/include/glui.h:223: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘GLUI_Node’
/usr/include/glui.h:224: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘GLUI_Main’
/usr/include/glui.h:225: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘GLUI_Panel’
/usr/include/glui.h:226: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘GLUI_Spinner’
/usr/include/glui.h:227: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘GLUI_RadioButton’
/usr/include/glui.h:228: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘GLUI_RadioGroup’
/usr/include/glui.h:229: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘GLUI_Separator’
/usr/include/glui.h:230: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘GLUI_Column’
/usr/include/glui.h:231: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘GLUI_Master’
/usr/include/glui.h:232: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘GLUI_Glut_Window’
/usr/include/glui.h:233: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘GLUI_Rollout’
/usr/include/glui.h:268: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘GLUI_Node’
/usr/include/glui.h:376: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘GLUI_Bitmap’
/usr/include/glui.h:399: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘GLUI_StdBitmaps’
/usr/include/glui.h:423: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘GLUI_Master_Object’
/usr/include/glui.h:500: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘GLUI_Master’
/usr/include/glui.h:510: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘GLUI_Glut_Window’
/usr/include/glui.h:547: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘GLUI_Main’
/usr/include/glui.h:668: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘GLUI_Control’
/usr/include/glui.h:834: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘GLUI_Button’
/usr/include/glui.h:871: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘GLUI_Checkbox’
/usr/include/glui.h:914: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘GLUI_Column’
/usr/include/glui.h:938: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘GLUI_Panel’
/usr/include/glui.h:968: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘GLUI_Rollout’
/usr/include/glui.h:1012: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘GLUI’
/usr/include/glui.h:1141: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘GLUI_EditText’
/usr/include/glui.h:1230: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘GLUI_RadioGroup’
/usr/include/glui.h:1265: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘GLUI_RadioButton’
/usr/include/glui.h:1303: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘GLUI_Separator’
/usr/include/glui.h:1335: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘GLUI_Spinner’
/usr/include/glui.h:1410: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘GLUI_StaticText’
/usr/include/glui.h:1435: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘GLUI_Listbox_Item’
/usr/include/glui.h:1442: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘GLUI_Listbox’
/usr/include/glui.h:1505: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘GLUI_Mouse_Interaction’
/usr/include/glui.h:1549: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘GLUI_Rotation’
/usr/include/glui.h:1597: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘GLUI_Translation’

What is the problem and how can i “avoid” this series of mistakes?

What OS, compiler, GLUI version do you use?

Please do not double-post! As already said, this has nothing to do with OpenGL and you would be best advised to ask at a forum devoted either to GLUI (whatever it may be) or your compiler (GCC, right?) .

lol Zengar, <joke>you are not patient this time!</joke>

You’re right, but GLUI users are more easily found on a opengl forum since this UI library works with opengl. This should be in the “Opengl toolkit” section maybe…

It has nothing to to with patience, I’m just stating the fact. Doesn’t mean that I want this guy from the forum or that I find his question inappropriate, but I think he will be better adviced with a general coding forum :slight_smile:

Anyway, I always found the “I can’t compile my code” questions a bit strange… one should be able to do at least so much on his own as a programmer (shouldn’t be an insult).

Ok, back to topic. I have absolutely no knowledge of C or C++, but my wild guess is that he uses the C compiler to compile his programm, with GLUT being a C++ code. No wonder the compiler cannot understand keywords like “class”.

So, try compiling with g++ (is it the correct one?)

Yes Zengar I completely agree. :slight_smile:

And yes this should be a compiler misuse and I think that his glui version is quite old, I can’t find the find the corresponding errors lines in the glui header installed on my computer. I use the version 2.3.

I use the version 2.2. The compilr is gcc-4.1 and linux ubuntu 7.10 i have. But even though i used the other verions i had mistakes.

By the way here is the makefile i made. You might fin a solution

GLIBS = -lglui -lglut -lGLU -lGL
XLIBS = -L/usr/X11R6/lib -lXext -lX11

cubemap : cubemap.o tga.o
gcc -o $@ -mtune=generic cubemap.o tga.o $(GLIBS) $(XLIBS) -lm

cubemap.o : cubemap.c tga.h
gcc -c cubemap.c

tga.o : tga.c tga.h
gcc -c tga.c

clean:
/bin/rm -f cubemap.o tga.o cubemap

Well, this is exactly what I suggested… you are using a C++ library from C code!

ok. I tied to compile it with g++ in linux but now i have these mistakes:

/usr/include/GL/glui.h:305: error: a class-key must be used when declaring a friend
/usr/include/GL/glui.h:305: error: friend declaration does not name a class or function
/usr/include/GL/glui.h:306: error: a class-key must be used when declaring a friend
/usr/include/GL/glui.h:306: error: friend declaration does not name a class or function
/usr/include/GL/glui.h:571: error: a class-key must be used when declaring a friend
/usr/include/GL/glui.h:571: error: friend declaration does not name a class or function
/usr/include/GL/glui.h:572: error: a class-key must be used when declaring a friend
/usr/include/GL/glui.h:572: error: friend declaration does not name a class or function
/usr/include/GL/glui.h:573: error: a class-key must be used when declaring a friend
/usr/include/GL/glui.h:573: error: friend declaration does not name a class or function
/usr/include/GL/glui.h:574: error: a class-key must be used when declaring a friend
/usr/include/GL/glui.h:574: error: friend declaration does not name a class or function
/usr/include/GL/glui.h:575: error: a class-key must be used when declaring a friend
/usr/include/GL/glui.h:575: error: friend declaration does not name a class or function

Any solution to this found? I’m getting the exact same errors…

I have taken this example
I changed the include path in the example from
#include “glui.h”
to
#include <GL/glui.h>

added glutInit
and changed this
char text[sizeof(GLUI_String)] = {“Hello World!”};
to this
char text[] = {“Hello World!”};

compiled with
gcc example3.cpp -lGL -lglui -o gluiExample
and everything compiled and run fine.

Glui version 2.36f (the one that came from apt-get)
FreeGlut 2.0.1 (the one that came from apt-get)
Gcc 4.5.1
Ubuntu 10.4

Try to compile the example, if you get the same error try to update the glui version.