Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
3.22/5 (2 votes)
See more:
I m trying to draw cylinder in C++ using OpenGL. I found some tutorial and code. But I m getting the following errors while compiling.

I checked all the necessary things like Properties->likner->Input->Additional Dependencies; Properties->likner->System->Subsystem->Windows to Console (/SUBSYSTEM:CONSOLE) etc . But nothing helps me out from this.

Can anyone helps me out?

Thanks.

C++
Error	1	error LNK2019: unresolved external symbol __imp__glutPostRedisplay@0 referenced in function _myKeyboardFunc	GluCylinders.obj
Error	2	error LNK2019: unresolved external symbol __imp__glutSwapBuffers@0 referenced in function _drawScene	GluCylinders.obj
Error	3	error LNK2019: unresolved external symbol __imp__glutMainLoop@0 referenced in function _main	GluCylinders.obj
Error	4	error LNK2019: unresolved external symbol __imp__glutDisplayFunc@4 referenced in function _main	GluCylinders.obj
Error	5	error LNK2019: unresolved external symbol __imp__glutReshapeFunc@4 referenced in function _main	GluCylinders.obj
Error	6	error LNK2019: unresolved external symbol __imp__glutSpecialFunc@4 referenced in function _main	GluCylinders.obj
Error	7	error LNK2019: unresolved external symbol __imp__glutKeyboardFunc@4 referenced in function _main	GluCylinders.obj
Error	8	error LNK2019: unresolved external symbol __imp__glutInitWindowSize@8 referenced in function _main	GluCylinders.obj
Error	9	error LNK2019: unresolved external symbol __imp__glutInitWindowPosition@8 referenced in function _main	GluCylinders.obj
Error	10	error LNK2019: unresolved external symbol __imp__glutInitDisplayMode@4 referenced in function _main	GluCylinders.obj
Error	11	error LNK2019: unresolved external symbol __imp____glutInitWithExit@12 referenced in function _glutInit_ATEXIT_HACK@8	GluCylinders.obj
Error	12	error LNK2019: unresolved external symbol __imp____glutCreateWindowWithExit@8 referenced in function _glutCreateWindow_ATEXIT_HACK@4	GluCylinders.obj
Error	13	fatal error LNK1120: 12 unresolved externals	.\Debug/cylinder.exe
Posted

1 solution

Please add glut.lib in additional dependencies.

Select Project Properties Page.
Configuration Properties > Linker > Input > Additional Dependencies.

GLUT( OpenGL Utility toolkit is not part VisualStudio.) We need to install glut from any of its implementations.

http://logs.tobinelectronics.com/installing-glut-in-windows-visual-studio-2010/
http://user.xmission.com/~nate/glut.html
 
Share this answer
 
Comments
docomo1 29-May-13 13:48pm    
I have all those things which u mentioned.
Santhosh G_ 29-May-13 22:22pm    
This link error indicates that certain functions import details are not available.
Please ensure glut32.lib exists, Is there any chance to have another version of glut in your linker path?. Please Check Additional lib folders, for the existance another glut.lib.
http://stackoverflow.com/questions/5159353/how-can-i-get-rid-of-the-imp-prefix-in-the-linker-in-vc
Mabukon 15-Jul-20 6:28am    
Thank you for the help! :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900