Hello
I have started coding using OpenGL yesterday using Dev-C++ compiler(http://www.bloodshed.net). I think this compiler comes with all the GL librairies and DLL but I am not sure.
So to start with I downloaded GLUT (headers n DLL) form this link: http://www.opengl.org/developers/documentation/glut/glutdlls36.zip
Then I tried to compiled this source which will just creat and display a window:
[/i]
#include <windows.h>
#include <glut.h>
void init(void)
{
glClearColor(1.0, 1.0, 1.0, 0.0) ;
glShadeModel(GL_FLAT) ;
}
void display(void)
{
glClear(GL_COLOR_BUFFER_BIT) ;
glutSwapBuffers() ;
}
int main(int argc, char** argv)
{
glutInit (&argc, argv) ;
glutInitDisplayMode (GLUT_DOUBLE | GLUT_RGB) ;
glutInitWindowSize (400, 100) ;
glutInitWindowPosition (100, 100) ;
glutCreateWindow (“First Chapter - Opening an OpenGL Window”) ;
init() ;
glutDisplayFunc (display) ;
glutMainLoop () ;
return 0 ;
}[/i]
And here are the linker errors I get:
c:\mes documents\untitled1.o: In function display(void)': //c/mes documents/untitled1.cpp:16: undefined reference to
glutSwapBuffers@0’
c:\mes documents\untitled1.o: In function main': //c/mes documents/untitled1.cpp:35: undefined reference to
glutInit@8’
//c/mes documents/untitled1.cpp:38: undefined reference to glutInitDisplayMode@4' //c/mes documents/untitled1.cpp:43: undefined reference to
glutInitWindowSize@8’
//c/mes documents/untitled1.cpp:47: undefined reference to glutInitWindowPosition@8' //c/mes documents/untitled1.cpp:52: undefined reference to
glutCreateWindow@4’
//c/mes documents/untitled1.cpp:59: undefined reference to glutDisplayFunc@4' //c/mes documents/untitled1.cpp:65: undefined reference to
glutMainLoop@0’
Can you help me ?