Jump to content
  • Advertisement
Sign in to follow this  
anachronistic89

OpenGL Trouble... Xcode Leopard Mac OpenGL & C++

This topic is 3754 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 am relatively new to OpenGL, but I know a bit of Python, PHP, and C++. So in order to learn how to use OpenGL, I was using the tutorials on Nehe Productions page. They seem pretty easy, and I understand the concepts and all.. what I don't understand, is why my program is not compiling. I use Mac OS 10.5.x, and I use Xcode for programming (I am also new to Xcode, and am still trying to figure it out) So specifically, my trouble comes with the following page: http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=Mac_OS_X I think the tutorial may be outdated, and perhaps some of the functions have been deprecated. I have looked on OpenGL's pages for the online man pages, but all I find is links to the official manual on Amazon. I have no idea how to use Xcode, and that is part of the problem. I don't understand what the errors mean. Please help if you can, I'd really like to continue with the tutorials, and I am stuck because I can't go further without being able to test and compile! Code (main.cpp):
#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;
}
Errors when I try to build: "DrawGLScene()", referenced from: _Z11DrawGLScenev$non_lazy_ptr in main.o "InitGL()", referenced from: _main in main.o "ReSizeGLScene(int, int)", referenced from: _Z13ReSizeGLSceneii$non_lazy_ptr in main.o symbol(s) not found collect2: Id returned 1 exit status Notes: I do have the libraries in my project folder.

Share this post


Link to post
Share on other sites
Advertisement

The Nehe tutorials are extremely outdated. Not that they're entirely worthless -- many of the concepts and algorithms described are still valid -- but the implementation is unlikely to work on modern platforms.

(Incidentally, OS X's "native" programming language is Objective-C, not C++. You should probably check in case XCode is trying to compile your C++ as Obj-C instead, though this is unlikely.)

Apple do include some OpenGL examples in their SDK, but you should probably go to the horse's mouth for up-to-date documentation and tutorials.

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!