在VC ++中编译代码时出错 [英] Error while Compiling the Code in VC++
本文介绍了在VC ++中编译代码时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我试图用OpenGL在C ++中绘制圆柱体。我找到了一些教程和代码。但是我在编译时遇到以下错误。
我检查了所有必要的东西,比如Properties-> likner-> Input-> Additional Dependencies; Properties-> likner-> System-> Subsystem-> Windows to Console(/ SUBSYSTEM:CONSOLE)等。但没有什么可以帮助我解决这个问题。
有人可以帮助我吗?
谢谢。
错误 1 错误LNK2019:未解析的外部符号__imp__glutPostRedisplay @ 0引用函数中的class =code-keyword> _myKeyboardFunc GluCylinders.obj
错误 2 错误LNK2019:未解析的外部符号__imp__glutSwapBuffers @ 0引用函数中的class =code-keyword> _drawScene GluCylinders.obj
错误 3 错误LNK2019:未解析的外部符号__imp__glutMainLoop @ 0引用 function _main GluCylinders.obj
错误 4 错误LNK2019:未解析的外部符号__imp__glutDisplayFunc @ 4引用函数中的class =code-keyword> _main GluCylinders.obj
错误 5 错误LNK2019:unresolve d外部符号__imp__glutReshapeFunc @ 4引用 函数_main GluCylinders.obj
错误 6 错误LNK2019:未解析的外部符号__imp__glutSpecialFunc @ 4引用 函数_main GluCylinders.obj
错误 7 错误LNK2019:未解析的外部符号__imp__glutKeyboardFunc @ 4引用 函数_main GluCylinders.obj
错误 8 错误LNK2019:未解析的外部符号__imp__glutInitWindowSize @ 8引用 函数_main GluCylinders.obj
错误 9 错误LNK2019:未解析的外部符号__imp__glutInitWindowPosition @ 8引用 函数_main GluCylinders.obj
错误 10 错误LNK2019:未解析的外部符号__imp__glu tInitDisplayMode @ 4引用 函数_main GluCylinders.obj
错误 11 错误LNK2019:未解析的外部符号__imp ____ glutInitWithExit @ 12引用 函数_glutInit_ATEXIT_HACK @ 8 GluCylinders.obj
错误 12 错误LNK2019:未解决外部符号__imp ____ glutCreateWindowWithExit @ 8引用 函数_glutCreateWindow_ATEXIT_HACK @ 4 GluCylinders.obj
错误 13 致命错误LNK1120: 12 未解析的外部.\Debug / cylinder.exe
解决方案
请在其他依赖项中添加glut.lib。
选择项目属性页面。
配置属性>链接器>输入>附加依赖项。
GLUT(OpenGL实用工具包不是VisualStudio的一部分。)我们需要安装任何实现的过剩。
http://logs.tobinelectronics.com/installing- glut-in-windows-visual-studio-2010 /
http:/ /user.xmission.com/~nate/glut.html
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.
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
解决方案
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
这篇关于在VC ++中编译代码时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文