Overclock.net - Overclocking.net
     
 
Home Gallery Reviews Blogs Register Today's Posts Mark Forums Read Members List


Go Back   Overclock.net - Overclocking.net > Software, Programming and Coding > Coding and Programming

Reply
 
LinkBack Thread Tools
Old 04-23-08   #1 (permalink)
Kernel Sanders
 
rabidgnome229's Avatar
 
intel nvidia

Join Date: Feb 2006
Location: Pittsburgh
Posts: 4,900
Blog Entries: 1

Rep: 549 rabidgnome229 is becoming famousrabidgnome229 is becoming famousrabidgnome229 is becoming famousrabidgnome229 is becoming famousrabidgnome229 is becoming famousrabidgnome229 is becoming famous
Unique Rep: 327
FAQs Submitted: 6
Trader Rating: 5
Default OpenGL Linking Help

I didn't get into the Computer Graphics class for next semester () so I'm going to teach myself opengl until can get into the class. I loaded up one of the early examples from the redbook and attempted to compile with gcc. (this is all happening on OSX 10.5.2)

Here's the ouptut
Code:
 gcc hello.c 
Undefined symbols:
  "_glEnd", referenced from:
      _display in ccAtIGKi.o
  "_glFlush", referenced from:
      _display in ccAtIGKi.o
  "_glMatrixMode", referenced from:
      _init in ccAtIGKi.o
  "_glutDisplayFunc", referenced from:
      _main in ccAtIGKi.o
  "_glutMainLoop", referenced from:
      _main in ccAtIGKi.o
  "_glutInitDisplayMode", referenced from:
      _main in ccAtIGKi.o
  "_glutInitWindoePosition", referenced from:
      _main in ccAtIGKi.o
  "_glClearColor", referenced from:
      _init in ccAtIGKi.o
  "_glColor3f", referenced from:
      _display in ccAtIGKi.o
  "_glBegin", referenced from:
      _display in ccAtIGKi.o
  "_glVertex3f", referenced from:
      _display in ccAtIGKi.o
      _display in ccAtIGKi.o
      _display in ccAtIGKi.o
      _display in ccAtIGKi.o
  "_glutInit", referenced from:
      _main in ccAtIGKi.o
  "_glOrtho", referenced from:
      _init in ccAtIGKi.o
  "_glLoadIdentity", referenced from:
      _init in ccAtIGKi.o
  "_glutCreateWindow", referenced from:
      _main in ccAtIGKi.o
  "_glClear", referenced from:
      _display in ccAtIGKi.o
  "_glutInitWindowSize", referenced from:
      _main in ccAtIGKi.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
I'm pretty sure that I just have to use some command line linking options, but I have no idea what I need to link to or where the libraries would be located (I've never had to link to any external libraries - just additional pieces of provided code for classes)

Here's the code in case it helps

Code:
#include <stdio.h>
#include <stdlib.h>
#include <GLUT/glut.h>

/* function prototypes */
/* opengl std */
void display();
void init();

int main(int argc, char **argv){
  glutInit(&argc, argv);
  glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);
  glutInitWindowSize(250, 250);
  glutInitWindoePosition(100, 100);
  glutCreateWindow("hello");
  init();
  glutDisplayFunc(display);
  glutMainLoop();
  return 0;
}

void display(){
  glClear(GL_COLOR_BUFFER_BIT);

  glColor3f(1.0, 1.0, 1.0);
  glBegin(GL_POLYGON);
    glVertex3f(0.25, 0.25, 0.0);
    glVertex3f(0.75, 0.25, 0.0);
    glVertex3f(0.75, 0.75, 0.0);
    glVertex3f(0.25, 0.75, 0.0);
  glEnd();

  glFlush();
}

void init(){
  glClearColor(0.0, 0.0, 0.0, 0.0);

  glMatrixMode(GL_PROJECTION);
  glLoadIdentity();
  glOrtho(0.0, 1.0, 0.0, 1.0, -1.0, 1.0);
}
__________________
BIG BROTHER
I put on my robe and wizard hat...

IS WATCHING

System: It goes to eleven
CPU
E6300
Motherboard
DS3
Memory
2GB XMS2 DDR2-800
Graphics Card
EVGA 8600GTS
Hard Drive
1.294 TB
Sound Card
Audigy 2 ZS
Power Supply
Corsair 520HX
Case
Lian-Li v1000B Plus
CPU cooling
TTBT
GPU cooling
Thermalright V2
OS
Arch Linux/XP
Monitor
Samsung 226bw
rabidgnome229 is offline Overclocked Account   Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools



All times are GMT -4. The time now is 03:24 AM.


Overclock.net is a Carbon Neutral Site Creative Commons License Internet Security By ControlScan

Terms of Service / Forum Rules | Privacy Policy | Advertising | Become an Official Vendor
Copyright © 2008 Shogun Interactive Development. Most rights reserved.
Page generated in 0.09283 seconds with 9 queries