Archived

This topic is now archived and is closed to further replies.

Mac beginner problems

This topic is 5135 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

Warning: Total OpenGL Newb. I tried working with both the tutorials on this site for simply setting up an OpenGL Window on Mac OSX. Using code: // START 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 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; } //END CODE and having included the glut and opengl frameworks in Mac''s project builder, I get the linking warning and error: "warning prebinding disabled because of undefined symbols" and "Undefined symbols: _DrawGLScene _InitGL _ResizeGLScene" Its been almost a half a year since I last worked in C++ and most of my experience has been in Java- so I assume my problem lies in that vice. If anyone can help out- I''d be much obliged.

Share this post


Link to post
Share on other sites
The code you post doesn''t define the functions DrawGLScene, InitGL or ResizeGLScene. That''s what the linker is complaining about, too.

If you actually wrote these functions, and included them in the compile and link, then chances are that your prototypes are wrong, such as missing an extern "C", or using an extern "C" where they shouldn''t be.

Share this post


Link to post
Share on other sites
Rather, I had this code in the middle of it all and it gave me the same errors (i just noticed that I had removed it in random frantic debugging right before I posted... (sorry)):

GLvoid InitGL(GLvoid);
GLvoid DrawGLScene(GLvoid);
GLvoid ReSizeGLScene(int Width, int Height);


Do I need to literally define these fuctions open/closed brace style? If so.. what in the world would go inside them? Nothing for now? Application-specific code?

Thanks again.

Share this post


Link to post
Share on other sites