Im trying to run a sipmple program in c++ using openGL but get these errors... can somebody please help me?

Error 1 error LNK2028: unresolved token (0A00002D) "extern "C" int __stdcall __glutCreateWindowWithExit(char const ,void (__cdecl)(int))" (?__glutCreateWindowWithExit@@$$J18YGHPBDP6AXH@Z@Z) referenced in function "extern "C" int __stdcall `anonymous namespace'::glutCreateWindow_ATEXIT_HACK(char const *)" (?glutCreateWindow_ATEXIT_HACK@?A0x6d0c8cb1@@$$J14YGHPBD@Z) c:\Users\Surané\documents\visual studio 2010\Projects\glut test\glut test\glut test.obj glut test

Error 2 error LNK2019: unresolved external symbol "extern "C" int __stdcall __glutCreateWindowWithExit(char const ,void (__cdecl)(int))" (?__glutCreateWindowWithExit@@$$J18YGHPBDP6AXH@Z@Z) referenced in function "extern "C" int __stdcall `anonymous namespace'::glutCreateWindow_ATEXIT_HACK(char const *)" (?glutCreateWindow_ATEXIT_HACK@?A0x6d0c8cb1@@$$J14YGHPBD@Z) c:\Users\Surané\documents\visual studio 2010\Projects\glut test\glut test\glut test.obj glut test

Error 3 error LNK1120: 2 unresolved externals c:\users\surané\documents\visual studio 2010\Projects\glut test\Debug\glut test.exe 1 1 glut test

Those errors coming from the use of a library suggest that you aren't properly linking to it. Did you make sure to link to the .lib/.dll file for OpenGL, or just include headers?

Link opengl32.lib and glu32.lib

Thx... i linked it! it works now

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.