Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > OpenGL In xcode

OpenGL In xcode
Thread Tools
Fresh-Faced Recruit
Join Date: Aug 2006
Location: London, UK
Status: Offline
Reply With Quote
Oct 14, 2006, 11:46 AM
 
Hi,

I recently started developing programs on OS X using C++ on 10.4.8. I'm not moving onto making a few OpenGL applications, but have hit a hurdle before even starting. I was following the OS X Window tutorial on nehe.gamedev.net and copied all the code in directly, and added the required frameworks (GLUT and OpenGL) using the Add - > Existing Frameworks option under Actions. I then try compiling and I get only one error, which is:


Linking

Undefined Symbols:
_DrawGLScene
_InitGL
_ReSizeGLScene
collect2: ld returned 1 exit status


I have tried using both a Carbon Project and a Cocoa project, both with exactly main.c file:

#include <OpenGL/gl.h>
#include <OpenGL/glu.h>
#include <GLUT/glut.h>

#define kWindowWidth 400
#define kWindowHeight 300

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

int main(int argc, char** argv) {
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH);
glutInitWindowSize (kWindowWidth, kWindowHeight);
glutCreateWindow(argv[0]);

InitGL();

glutDisplayFunc(DrawGLScene);
glutReshapeFunc(ReSizeGLScene);

glutMainLoop();
return 0;

}

Why does this same error keep appearing? I cannot find a solution to it.

Thanks very much,

Regards, George Buckingham
     
Mac Elite
Join Date: Jul 2002
Status: Offline
Reply With Quote
Oct 14, 2006, 05:09 PM
 
Try the C++ tool project template.

And I've also heard of the need to include some Cocoa framework or header for all OGL functionality.
     
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status: Offline
Reply With Quote
Oct 14, 2006, 09:32 PM
 
It looks like you haven't actually defined those functions. Have you?
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 02:38 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2