Ok, I'm new to OpenGL, and relativelly new to ProjectBuilder, so bear with me.
I'm working through the simple OpenGL tutorial in the most recent MacTech magazine, and I can't get the first code segment to run.
Code:
#import "MyOpenGLView.h"
#import <GLUT/glut.h>
@implementation MyOpenGLView
- (void)drawRect: (NSRect) theRect
{
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluOrtho2D(0., 2., 0., 1.);
glClearColor(1.0, 1.0, 1.0, 1.0);
glClear(GL_COLOR_BUFFER_BIT);
glColor3f(0.0, 0.0, 1.0);
glLineWidth(1.0);
glBegin(GL_LINE_LOOP);
glVertex2f(0.85, 0.05);
glVertex2f(1.95, 0.05);
glVertex2f(1.80, 0.85);
glVertex2f(0.20, 0.85);
glEnd();
glFlush();
}
@end
Compiler/Linker Errors:
/usr/bin/ld: /Volumes/Data/Documents/Programming Projects/OpenGL/build/intermediates/OpenGL.build/master.o illegal reference to symbol: _glBegin defined in indirectly referenced dynamic library /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib
/usr/bin/ld: /Volumes/Data/Documents/Programming Projects/OpenGL/build/intermediates/OpenGL.build/master.o illegal reference to symbol: _gluOrtho2D defined in indirectly referenced dynamic library
/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLU.dylib
The linker is choking on _glBegin and _gluOrtho2D.
Note: I have added the GLUT.Framework to the project.
- Mike