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 > Cocoa OpenGL Errors - illegal reference to symbol

Cocoa OpenGL Errors - illegal reference to symbol
Thread Tools
Senior User
Join Date: Oct 2000
Location: Lawrence, KS
Status: Offline
Reply With Quote
Mar 22, 2002, 10:27 PM
 
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 &lt;GLUT/glut.h&gt;

@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
Reply With Quote
Mar 23, 2002, 07:24 AM
 
You need to link against OpenGL.framework. Do this by adding it to your project (Project -&gt; Add Frameworks...).
     
DaGuy  (op)
Senior User
Join Date: Oct 2000
Location: Lawrence, KS
Status: Offline
Reply With Quote
Mar 23, 2002, 08:29 AM
 
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
Reply With Quote
Mar 23, 2002, 09:44 AM
 
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
Reply With Quote
Mar 23, 2002, 10:37 PM
 
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
Reply With Quote
Mar 27, 2002, 12:08 AM
 
You can get online versions of the Red and Blue book here:
http://ask.ii.uib.no/ebt-bin/nph-dwe...oper/OpenGL_PG http://ask.ii.uib.no/ebt-bin/nph-dwe...oper/OpenGL_RM


These are very old versions however, so they don't include newer features in OpenGL, some of which are very useful. I recommend you just go out and buy the 1.2 version of the OpenGL Programming Guide (the Red Book). You won't regret it. You needn't bother with the blue book, as it's pretty much the same thing as the OpenGL man pages that come with the developer tools. Here's the official list of OpenGL books (The Red Book is the first one):
http://www.opengl.org/developers/doc...ion/books.html
self = [[JeffBinder alloc] init];
     
   
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:24 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