Skip to main content
gamedev.net
🔒 Locked

Mac beginner problems

Started by aaronchang Nov 27, 2003 at 7:44 PM 2 replies 300+ views
Original Post
aaronchang
aaronchang
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.
hplus0603
hplus0603
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.
enum Bool { True, False, FileNotFound };
aaronchang
aaronchang
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.
aaronchang
aaronchang
I spoke too soon.. I just went and implemented what I suggested in my last post and it worked. Sorry to bother

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.