Link to home
Start Free TrialLog in
Avatar of Raydot
Raydot

asked on

Configure GLUT for Jaguar

Howdy,

I've been trying for the past two days to configure the GLUT for OS X 10.3 for a simple project.  The Mac demos and documentation on OpenGL for Cocoa are less than verbose, don't always work, are written in Objective-C and don't use the GLUT.  When I follow the tutorial at:

http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=MacOSX

I get "Undefined symbols: _DrawGLScene _InitGL _ResizeGLScene" errors, which I can't figure out.  I searched through the class files and I can't find them.  So then I'd suspect that I have an old version of the GLUT, but when I pbxbuild install the one I download from Apple, I get an error telling me (among other things) that:

ld: table of contents for archive: ./libForeground.a is out of date; rerun ranlib(1) (can't load from it)

It seems it shouldn't be this hard, what am I doing wrong?
Avatar of mphanke
mphanke
Flag of Switzerland image

Hi,

I have no idea on Mac OpenGL but have you downloaded the NeHe base code? It was my problem in the beginning. Further the errors showing up above ("Undefined symbols: _DrawGLScene _InitGL _ResizeGLScene") look like you are using some functions which are not defined in the source, I don't believe it is a problem with the GLUT lib.

This error usually originates from using a the functions mentioned above in one of the GLUT functions where you define which function is supposed to be used for drawing, resizing and so on.

Hope this helps,

Martin

P.S. I came here from the other post in OpneGL section.
Avatar of Raydot
Raydot

ASKER

NeHe Base code?  Is that different from what I posted in the link above?

Hi,

yep, if you look at the homepage ( nehe.gamedev.net ) on the left side you will find something saying nehe basecode. Download it this should solve your issues.

Martin
You are calling functions which are declared but not defined.
Look at some easy examples like the Triangle one which is something further in the tutorials. These functions have to be declared! Then all your problems should be resolved. Otherwise post here and I will give you some more advise. Please try to post some more precise errors / warnings.

The issue might be resolved if you do:

GLvoid InitGL(GLvoid) {}
GLvoid DrawGLScene(GLvoid) {}
GLvoid ReSizeGLScene(int Width, int Height) {}

Then the functions are defined and the code should run.

Martin
You are calling functions which are declared but not defined.
Look at some easy examples like the Triangle one which is something further in the tutorials. These functions have to be declared! Then all your problems should be resolved. Otherwise post here and I will give you some more advise. Please try to post some more precise errors / warnings.

The issue might be resolved if you do:

GLvoid InitGL(GLvoid) {}
GLvoid DrawGLScene(GLvoid) {}
GLvoid ReSizeGLScene(int Width, int Height) {}

Then the functions are defined and the code should run.

Martin
Avatar of Raydot

ASKER

Hm.  Well those are the error messages I get, I don't see how I could be more specific.  And the green triangle code isn't great for two reasons: 1) it doesn't use the GLUT and 2) the code as written returns an error if you call the file something like "green triangle" as opposed to a name with no spaces in it like "green_triangle"

Still and all, I think you were right, I changed the function prototypes.  On NeHe's site, they're listed as:

GLvoid InitGL(GLvoid);
GLvoid DrawGLScene(GLvoid);
GLvoid ReSizeGLScene(int Width, int Height);

But your version seemed to work...almost.  I did get three warnings, all of which basically read:

"warning dynamic shared library: /System/Library/Frameworks/Carbon.framework/Carbon not made a weak library in output with MACOSX_DEPLOYMENT_TARGET environment variable set to: 10.1"

...which I'm told is nothing to worry about.  

Is this different in the code on the site vs. the code for download?

Let me take this around the block a bit, and if it all holds together, the points are yours.
ASKER CERTIFIED SOLUTION
Avatar of mphanke
mphanke
Flag of Switzerland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Raydot

ASKER

I bet you thought I forgot about this...I actually did go download that code.  It's written in ObjectiveC, but it works.  So the points are yours!  Thanks.