Hey all,
Well, I just downloaded GLUI 2.1beta and am trying to get the example1 to compile. Anyone know how? I’m using CWPro6, MacOS9.1, on a PowerBook Pismo (Firewire). I created a new project and put the “example1.cpp”, along with the usual ANSI, Mac, and OpenGL libs (including glut.lib). Basically, when I try compiling it complains about “illegal ‘friend’ declarations” in glui.h (in every place a class is declared a friend) . Anyone know what’s going on? I’ve enabled c++ and all that.

Ravi Mathur

OK, I figured it out. To build a GLUI library out of the given sources, using CodeWarrior, here’s what you do. Make a new empty project, and set it up to use the “MacOS PPC Linker” with the “Library” project type. Name the file whatever you want (I used “glui.lib”). Add all the source files EXCEPT “ppm2array.cpp” (this file uses some classes which weren’t supplied with the distribution). Now build the project, and you should get a GLUI library! In some cases, you may get a bunch of “illegal friend declaration” errors in “glui.h”. If this is the case, go into “glui.h” and change all instances of:
friend <any class_name here>
friend class <any class_name here>
I’m not sure why this discrepancy is there. I’ve seen C++ books that use the former declaration, and some that use the latter.

Note that this method of building the GLUI library can also be used to build the GLOW library. Just add all the GLOW sources to the project, and build.

Hope this helps,
Ravi Mathur

One thing I forgot to mention about building the GLUI library. You need to remove all source files ending in “.c” (as opposed to “.cpp”) from your project. Those files should be in the same folder as the rest of the sources and headers, but should NOT be in the actual project. This is because they contain only data and no code, so the resulting library would have multiple definitions of the same code.


This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.