Sign in to follow this  

Undefined symbols

This topic is 4381 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have searched all around for a solution to this problem but I still havent found anything that works. I am trying to start playing with OpenGL using this guide: http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=Mac_OS_X but every-time I try to compile I get en error saying: /usr/bin/ld: Undefined symbols: DrawGLScene() ReSizeGLScene(int, int) InitGL() collect2: ld returned 1 exit status I have added the GLUT framework and the OpenGL framework to the project. I am using Xcode 2.2 on Tiger 10.4.3 and the code I am trying to compile looks like this:
#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;
}

The build transcript says: Building target “opengltest” of project “opengltest” Checking Dependencies CompileC build/opengltest.build/Debug/opengltest.build/Objects-normal/ppc/main.o /Users/Novaoblivion/opengltest/main.m normal ppc c++ com.apple.compilers.gcc.4_0 cd /Users/Novaoblivion/opengltest /usr/bin/gcc-4.0 -x c++ -arch ppc -pipe -Wno-trigraphs -fpascal-strings -fasm-blocks -g -O0 -Wreturn-type -Wunused-variable -fmessage-length=0 -mtune=G5 -fvisibility=hidden -fvisibility-inlines-hidden -mfix-and-continue -Wno-invalid-offsetof -I/Users/Novaoblivion/opengltest/build/opengltest.build/Debug/opengltest.build/opengltest.hmap -F/Users/Novaoblivion/opengltest/build/Debug -I/Users/Novaoblivion/opengltest/build/Debug/include -I/Users/Novaoblivion/opengltest/build/opengltest.build/Debug/opengltest.build/DerivedSources -isysroot /Developer/SDKs/MacOSX10.4u.sdk -c /Users/Novaoblivion/opengltest/main.m -o /Users/Novaoblivion/opengltest/build/opengltest.build/Debug/opengltest.build/Objects-normal/ppc/main.o Ld /Users/Novaoblivion/opengltest/build/Debug/opengltest.app/Contents/MacOS/opengltest normal ppc cd /Users/Novaoblivion/opengltest /usr/bin/g++-4.0 -o /Users/Novaoblivion/opengltest/build/Debug/opengltest.app/Contents/MacOS/opengltest -L/Users/Novaoblivion/opengltest/build/Debug -F/Users/Novaoblivion/opengltest/build/Debug -filelist /Users/Novaoblivion/opengltest/build/opengltest.build/Debug/opengltest.build/Objects-normal/ppc/opengltest.LinkFileList -framework Cocoa -framework GLUT -framework OpenGL -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk /usr/bin/ld: Undefined symbols: DrawGLScene() ReSizeGLScene(int, int) InitGL() collect2: ld returned 1 exit status Thanks.

Share this post


Link to post
Share on other sites
You were the one to declare those functions so you need to be the one to define the functions. The code for them are in the windows version of that lesson.

Share this post


Link to post
Share on other sites

This topic is 4381 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this