View Full Version : GLUT Library for MPW

03-14-2001, 03:00 PM
Pavia, 3/15/2001

Hi to everybody.
My problem is:

With the OpenGL SDK from Apple, together with the MPW programming shell, I
cannot get compiled any source with GLUT functions because the new compiled
GlutLib do not work. The language I use is the ANSI C.

What do I ask:

Do you have any suggestion (hint?) to understand where is the problem? Why
does it not work? Is there a bug?
I guess it should be easy. I am a beginner in the programming.
Do you know where could I get the MPW compatible GLUT and MUI libraries?
If you cannot help me, could you forward this e-mail to somebody who can?

Thank you


All what I have tried.

I downloaded the OpenGL SDK from Apple. In its folder "Libraries" there are
6 files. 3 have the Type: shlb and Creator: OGPL and are: OpenGLLibraryStub;
OpenGLMemoryStub and OpenGLUtilityStub.
The other 3 files are from CodeWarrior: Type: MPLF and Creator CWIE and are:
Carbon_glut.lib; glut.lib and mui.lib .

In the book from Apple "Programmer's Guide of the OpenGL SDK", I found
As delivered, OpenGL comes with CodeWarrior-compatible libraries for TK,
AUX, GLUT and MUI. If you are not using CodeWarrior, it may be necessary to
recompile the TK, AUX GLUT and MUI static libraries.

In the folder Source there are two folders: GLUT 3.7 and MUI with the
sources of the glut and mui libraries with the necessary "includes.h" and CW
project files. 66 files altogether.

I added the headers from the OpenGL SDK to the headers file of my MPW
I added the 6 libraries to the shared Libraries folder of my MPW program.
I added the libraries to the linker commands and compiled a small program
with only AGL function. The compiler and the linker worked w/o problems (of
course I do not need the glut libraries).

I tried to compile a source with some GLUT function. The linker did not
work. It produced the following error message:

File ":GLSource.c.x"
Reference to unresolved symbol ".glutInitDisplayMode"
# Unresolved external references:
# .glutInitDisplayMode

I got the same type of error message for each of the 4 GLUT function present
in the source file.

So I compiled the GLUT 3.7 library as static library.
I put the new compiled files in the shared Library folder of my MPW program.
I added the library to the linker commands and tried to compile the source
with the GLUT function.

I got the same error message but about items from inside the new compiled

Reference to unresolved symbol "DSpProcessEvent"
# Unresolved external references
# DSpProcessEvent
(even for InitContextualMenus(), DSpContext_FadeGammaOut,
DSpContext_SetState, DSpContext_FadeGammaIn, DSpShutdown (),
glutContextualMenuSelect and DSpContext_Release).
At this point I checked from which source library came the problem and in
which CIncludes.h could be the reference. Than I added to the glut files the
necessary #include<> and compiled the static GlutLib library again.
I tried to compile my source again. I got the same error messages as before
and this happened even with the code source w/o glut functions.

There is a file in GLUT 3.7 for CodeWarrior, project.pch; inside only one
source line:
#define TARGET_API_MAC_OS8 1
By compiling of the static GlutLib I did not include it. Only I choused the
"PowerPC" and "classic" in the command window of the MPW copiler. There is
also the option "carbon" under "PowerPC" and a file "carbon_project.pch"
with inside #define TARGET_API_MAC_CARBON 1 under the CodeWarrior GLUT 3.7