NeHe example

djohnson
Unregistered
 
Post: #1
Ok, I am starting to learn OpenGL. I found NeHe's excellent examples but am having a problem. I have the code the setup a window and OpenGLView, but I dont want to go that route. I am working on a few game ideas, and want to try and keep them portable. When I run through the first example and try to setup a new project as they suggest, I get an error on the link. Here is what I have:

Code:
#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;
}


Also I have link the following frameworks: Cocoa.framework, GLUT.framework, and OpenGL.framework. It will compile no problem, but when it links I get the following error:

Code:
/usr/bin/ld: Undefined symbols:
_DrawGLScene
_InitGL
_ReSizeGLScene


Now, what am I missing??? Blink
Quote this message in a reply
djohnson
Unregistered
 
Post: #2
Ok, got it working. Forgot to add some other functions Grin Well it is a little slow... Maybe I should just use the Cocoa OpenGLView instead...
Quote this message in a reply
Member
Posts: 72
Joined: 2006.10
Post: #3
<Begin Shameless Plug>

See nehe's cocoa basecode ( on the left of the main page ). The Cocoa structure is kept to a minimum while the rest of the base is pure C++/OpenGL ( i.e. very easy to port ).

- Sohta
Quote this message in a reply
djohnson
Unregistered
 
Post: #4
Yes I grabbed that right before heading to work today. I will use it until I make my own. Thanks!
Quote this message in a reply
Member
Posts: 72
Joined: 2006.10
Post: #5
np , I you have any problem with it, don't hesitate and tell me, I'll fix it right away.

I won't lie to you, it's just a little something I patched up quickly, so, it might be a little rough around the edges.

- Sohta
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Errors With NeHe OpenGL Guide SamGray 1 2,773 Sep 6, 2009 02:36 PM
Last Post: AnotherJake
  NeHe revival? Duane 20 8,213 Jul 11, 2007 09:57 AM
Last Post: AnotherJake
  nehe tutorials - fullscreen Michael 5 4,224 Oct 28, 2004 08:08 AM
Last Post: Michael
  NeHe and OpenGL Inconsistencies Justin Brimm 4 3,614 Jul 11, 2003 08:18 AM
Last Post: Feanor