Newbie wiht xcode/opengl

S

seoushi

Guest
Newbie with xcode/opengl

I read a simular thread but it just didn't help me.

I'm trying to make a simple opengl program and am following nehe's tutorials. (link to the tutorial http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=Mac_OS_X ). I just downloaded XCode 1.2 and am new to programing on mac os x (I've done alot of c++ on linux).

Anyways I make a new project under xcode, select cocoa app then add glut and opengl frameworks.

Then I have copied the code line for line from the tutorial jsut to make sure that it works, but I just get
Code:
ZeroLink: unknown symbol '_DrawGLScene'

Simple OGL has exited due to signal 6 (SIGABRT).

here is my application code
Code:
//simple opengl program from nehe mac os tutorial

#include <OpenGL/gl.h>		// Header File For The OpenGL32 Library
#include <OpenGL/glu.h>		// Header File For The GLu32 Library
#include <GLUT/glut.h>		// Header File For The GLut Library

#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);
	glutInitWindowPosition (100, 100);
	glutCreateWindow (argv[0]);

	InitGL();

	glutDisplayFunc(DrawGLScene);
	glutReshapeFunc(ReSizeGLScene);

	glutMainLoop();

	return 0;
}

Obviously I've missed a step somewhere, where did I go wrong?
 
OP
S

seoushi

Guest
Well that was pretty stupid, but the problem was I forgot some braces. When I declared the 3 functions right before main it, they needed braces, that was all. If anyone else follow these tutorials that a little heads up.
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top