 |
 |
Cocoa OpenGL Errors - illegal reference to symbol
|
 |
|
 |
|
Senior User
Join Date: Oct 2000
Location: Lawrence, KS
Status:
Offline
|
|
Do any of you know how to handle this type of error? I am linking to the OpenGL framework and I swear that I haven't been messing around with system files as root -I learned my lesson some time ago
<font color = red> /usr/bin/ld: /Users/bido/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: /Users/bido/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 </font>
Here's the code:
<font color = blue>
#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.05, 0.05);
glVertex2f(1.95, 0.05);
glVertex2f(1.80, 0.85);
glVertex2f(0.20, 0.85);
glEnd();
glFlush();
}
@end </font>
Thanks!

]
[ 03-22-2002: Message edited by: DaGuy ]
|
|
iMac 17" G4 800MHZ & 768 SDRAM
|
| |
|
|
|
 |
|
 |
|
Addicted to MacNN
Join Date: Mar 2000
Location: London, UK
Status:
Offline
|
|
You need to link against OpenGL.framework. Do this by adding it to your project (Project -> Add Frameworks...).
|
|
|
| |
|
|
|
 |
|
 |
|
Senior User
Join Date: Oct 2000
Location: Lawrence, KS
Status:
Offline
|
|
Thanks Angus_D, that took care of it. I was just linking to the GLUT framework. What do you recommend for a good OpenGL book . My preference is the O'Reilly type of book -whatever that means.
Thanks again,

|
|
iMac 17" G4 800MHZ & 768 SDRAM
|
| |
|
|
|
 |
|
 |
|
Professional Poster
Join Date: Apr 2001
Location: Long Beach, CA
Status:
Offline
|
|
Originally posted by DaGuy:
<STRONG>Thanks Angus_D, that took care of it. I was just linking to the GLUT framework. What do you recommend for a good OpenGL book . My preference is the O'Reilly type of book -whatever that means.
Thanks again,
 </STRONG>
There are plenty of good references on the internet. Go to google and do a search for "OpenGL developer documentation." OpenGL.org has good documentation, and the search will pop up several more sources.
|

ACSA 10.4/10.3, ACTC 10.3, ACHDS 10.3
|
| |
|
|
|
 |
|
 |
|
Forum Regular
Join Date: Feb 2002
Location: Fort Lauderdale, Florida
Status:
Offline
|
|
I don't have the links on hand, but there are two free books you can download that are ok, especially since they are free. Most people call them the blue and the red book. One is instruction and one is reference.
If i find it, i will post it here.
|
|
|
| |
|
|
|
 |
|
 |
|
Junior Member
Join Date: Feb 2002
Status:
Offline
|
|
|
|
|
self = [[JeffBinder alloc] init];
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|