Okay so I followed a tutorial to get this code to try glut...
Code:
#include<gl\glut.h>//This header file contains all the commands for the OpenGL Utility Toolkit
//function to initialize GLUT settings
void init()
{
glClearColor(0,0,0,0);//(NEW) we define the background color here
}
//The function where all the drawing occurs
void display()
{
glClear(GL_COLOR_BUFFER_BIT);//Clear the screen
glFlush();//Draw everything to the screen
glutPostRedisplay();//Tell the program to refresh
}
int main(int argc, char** argv)
{
glutInit(&argc, argv);//initialize GLUT.
glutInitWindowSize(800,600);//define the window size as 800 pixels wide and 600 pixels high glutInitWindowPosition(10,50);//Set the window position at (10,50)
glutInitDisplayMode(GLUT_SINGLE|GLUT_RGB);//Set the initial display mode
glutCreateWindow("Lesson 1");//Create our window
init();//call init()
glutDisplayFunc(display);//tell GLUT what our display function is
glutMainLoop();//Tell the program we are not done yet
}
but i get these errors.. what am i doing wrong?
Code:
obj\Debug\main.o||In function `glutInit_ATEXIT_HACK':|
C:\Program Files\CodeBlocks\MinGW\bin\..\lib\gcc\mingw32\3.4.5\..\..\..\..\include\gl\glut.h|483|undefined reference to `___glutInitWithExit@12'|
obj\Debug\main.o||In function `glutCreateWindow_ATEXIT_HACK':|
C:\Program Files\CodeBlocks\MinGW\bin\..\lib\gcc\mingw32\3.4.5\..\..\..\..\include\gl\glut.h|500|undefined reference to `___glutCreateWindowWithExit@8'|
obj\Debug\main.o||In function `glutCreateMenu_ATEXIT_HACK':|
C:\Program Files\CodeBlocks\MinGW\bin\..\lib\gcc\mingw32\3.4.5\..\..\..\..\include\gl\glut.h|546|undefined reference to `___glutCreateMenuWithExit@8'|
||=== Build finished: 3 errors, 0 warnings ===|