Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > OpenGL Error

OpenGL Error
Thread Tools
Forum Regular
Join Date: Jan 2001
Status: Offline
Reply With Quote
Mar 3, 2002, 08:50 AM
 
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
     
Admin Emeritus
Join Date: Oct 2000
Location: Boston, MA
Status: Offline
Reply With Quote
Mar 3, 2002, 01:19 PM
 
I think that you now have to add the OpenGL framework as well.
"Against stupidity, the gods themselves contend in vain" (Schiller)
     
nibeck  (op)
Forum Regular
Join Date: Jan 2001
Status: Offline
Reply With Quote
Mar 3, 2002, 07:15 PM
 
Well if that's not what you call obvious I don't know what is ;-)

Thanks, works like a champ now.

- Mike
     
Admin Emeritus
Join Date: Oct 2000
Location: Boston, MA
Status: Offline
Reply With Quote
Mar 4, 2002, 05:51 PM
 
Originally posted by nibeck:
<STRONG>Well if that's not what you call obvious I don't know what is ;-)

Thanks, works like a champ now.

- Mike</STRONG>
Hehe, it used to be that you could just use the GLUT framework.
"Against stupidity, the gods themselves contend in vain" (Schiller)
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 12:13 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2