问题描述
原始问题:
应用了包括glut.h的海报建议之一后,我现在遇到了这个问题.
After applying one of the poster's suggestions of including glut.h, I now get this problem.
没有它,我无法使用glutSolidSphere().
I can't use glutSolidSphere() without it.
[链接器错误]未定义的引用 `__glutCreateWindowWithExit @ 8'
[Linker error] undefined reference to `__glutCreateWindowWithExit@8'
[链接器错误]未定义的引用 `__glutCreateMenuWithExit @ 8'
[Linker error] undefined reference to `__glutCreateMenuWithExit@8'
[链接器错误]未定义的引用 `glutSolidSphere @ 16'
[Linker error] undefined reference to `glutSolidSphere@16'
我正在使用DEV C ++,如果有帮助的话.
I'm using DEV C++, if that helps.
推荐答案
将-lglut32
选项传递给mingw的链接器-Dev-Cpp使用mingw.
Pass -lglut32
option to mingw's linker - Dev-Cpp uses mingw.
您将必须在项目选项"中的某个地方找到链接器选项"文本框.抱歉,我不能比这更具体,自从我使用Dev-Cpp已经超过一年了,而从真的开始使用它已经过去了三年多.它应该与添加-lopengl32
和-lglu32
的位置相同.
You'll have to find "linker options" textbox somewhere in Project Options. Sorry I cannot be more specific than that, it's been over a year since I used Dev-Cpp, and over three years since I really used it. It should be the same place where you added -lopengl32
and -lglu32
.
不要忘记安装 GLUT devpak .
这篇关于这些对__glut * WithExit的OpenGL链接器错误的未定义引用是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!