PDA

View Full Version : Errors during compiling opengl , c++ code



animaks
07-04-2012, 04:08 AM
Error 1 error LNK2019: unresolved external symbol __imp__glutInitContextProfile@4 referenced in function "void __cdecl InitWindow(int,char * * const)" (?InitWindow@@YAXHQAPAD@Z)


Error 2 error LNK2019: unresolved external symbol __imp__glutInitContextFlags@4 referenced in function "void __cdecl InitWindow(int,char * * const)" (?InitWindow@@YAXHQAPAD@Z)


Error 3 error LNK2019: unresolved external symbol __imp__glutInitContextVersion@8 referenced in function "void __cdecl InitWindow(int,char * * const)" (?InitWindow@@YAXHQAPAD@Z)


Error 4 error LNK1120: 3 unresolved externals

I can't understand the problem, please help.
Thanks

rakeshthp
07-04-2012, 04:21 AM
Error 1 error LNK2019: unresolved external symbol __imp__glutInitContextProfile@4 referenced in function "void __cdecl InitWindow(int,char * * const)" (?InitWindow@@YAXHQAPAD@Z)


Error 2 error LNK2019: unresolved external symbol __imp__glutInitContextFlags@4 referenced in function "void __cdecl InitWindow(int,char * * const)" (?InitWindow@@YAXHQAPAD@Z)


Error 3 error LNK2019: unresolved external symbol __imp__glutInitContextVersion@8 referenced in function "void __cdecl InitWindow(int,char * * const)" (?InitWindow@@YAXHQAPAD@Z)


Error 4 error LNK1120: 3 unresolved externals

I can't understand the problem, please help.
Thanks


I guess, you haven't linked glut library while building your program.

animaks
07-04-2012, 04:26 AM
No, I did: Linker>Input...

rakeshthp
07-04-2012, 04:46 AM
Check this

http://msdn.microsoft.com/en-us/library/799kze2z(v=vs.80).aspx

animaks
07-04-2012, 05:24 AM
Here wasn't the declaration of my problem :(

thokra
07-04-2012, 07:30 AM
It's definitely a linker error. Are you absolutely sure you have added freeglut.lib? BTW, kudos on opening yet another thread ...