Jump to content
  • Advertisement
Sign in to follow this  
Novaoblivion

Undefined symbols

This topic is 4596 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
Advertisement
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!