Chiyu Wang
04-13-2005, 11:45 AM
[Linker error] undefined reference to `glClear@4'
[Linker error] undefined reference to `glColor3f@12'
I had the code:
#include <cstdlib>
#include <iostream>
#include <GL/gl.h>
#include <GL/glu.h>
#include <GL/glut.h>
#include <windows.h>
#include <stdlib.h>
#include <stdio.h>
#include <vector>
//#include <libiberty.h>
using namespace std;
int main(int argc, char *argv[])
{
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();
return 0;
}
I don't know where is the problem
I have copied the glut.h to the ../GL/
glut32.dll and glut.dll to ../system32
glut32.lib and glut.lib to ../lib
[Linker error] undefined reference to `glColor3f@12'
I had the code:
#include <cstdlib>
#include <iostream>
#include <GL/gl.h>
#include <GL/glu.h>
#include <GL/glut.h>
#include <windows.h>
#include <stdlib.h>
#include <stdio.h>
#include <vector>
//#include <libiberty.h>
using namespace std;
int main(int argc, char *argv[])
{
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();
return 0;
}
I don't know where is the problem
I have copied the glut.h to the ../GL/
glut32.dll and glut.dll to ../system32
glut32.lib and glut.lib to ../lib