我正在尝试编译这个利用 GLUT32 库的 C++ 程序。
现在我收到以下错误:
错误 1 错误 LNK2001:无法解析的外部符号 _gluPerspective@32 Camera.obj soundCube 错误 2 错误 LNK2001:无法解析的外部符号 _gluLookAt@72 Camera.obj soundCube 错误 3 错误 LNK2001:无法解析的外部符号 __imp__glMaterialfv@12 GLWindow.obj soundCube 错误 4 错误 LNK2001:无法解析的外部符号 __imp__glClear@4 GLWindow.obj soundCube 错误 5 错误 LNK2001:无法解析的外部符号 __imp__glClearColor@16 GLWindow.obj soundCube 错误 6 错误 LNK2001:无法解析的外部符号 __imp__glMaterialf@12 GLWindow.obj soundCube 错误 7 错误 LNK2001:无法解析的外部符号 __imp__glEnd@ 0 GLWindow.obj soundCube 错误 8 错误 LNK2001:无法解析的外部符号 __imp__glRasterPos2f@8 GLWindow.obj soundCube 错误 9 错误 LNK2001:无法解析的外部符号 __imp__timeGetTime@0 GLWindow.obj soundCube 错误 10 错误 LNK2001:无法解析的外部符号 __imp__glDisable@4 GLWindow.obj soundCube 错误 11 错误 LNK2001:无法解析的外部符号 __imp__glBegin@4 GLWindow.obj soundCube 错误 12 错误 LNK2001:无法解析的外部符号 __imp__glColor4f@ 16 GLWindow.obj soundCube 错误 13 错误 LNK2001:无法解析的外部符号 __imp__glPopMatrix@0 GLWindow.obj soundCube 错误 14 错误 LNK2001:无法解析的外部符号 __imp__glPushMatrix@0 GLWindow.obj soundCube 错误 15 错误 LNK2001:无法解析的外部符号 __imp__glRotatef@16 GLWindow.obj soundCube错误 16 错误 LNK2001:无法解析的外部符号 __imp__glBlendFunc@8obj soundCube 错误 10 错误 LNK2001:无法解析的外部符号 __imp__glDisable@4 GLWindow.obj soundCube 错误 11 错误 LNK2001:无法解析的外部符号 __imp__glBegin@4 GLWindow.obj soundCube 错误 12 错误 LNK2001:无法解析的外部符号 __imp__glColor4f@16 GLWindow.obj soundCube 错误 13 错误LNK2001:无法解析的外部符号 __imp__glPopMatrix@0 GLWindow.obj soundCube 错误 14 错误 LNK2001:无法解析的外部符号 __imp__glPushMatrix@0 GLWindow.obj soundCube 错误 15 错误 LNK2001:无法解析的外部符号 __imp__glRotatef@16 GLWindow.obj soundCube 错误 16 错误 LNK2001:无法解析的外部符号__imp__glBlendFunc@8obj soundCube 错误 10 错误 LNK2001:无法解析的外部符号 __imp__glDisable@4 GLWindow.obj soundCube 错误 11 错误 LNK2001:无法解析的外部符号 __imp__glBegin@4 GLWindow.obj soundCube 错误 12 错误 LNK2001:无法解析的外部符号 __imp__glColor4f@16 GLWindow.obj soundCube 错误 13 错误LNK2001:无法解析的外部符号 __imp__glPopMatrix@0 GLWindow.obj soundCube 错误 14 错误 LNK2001:无法解析的外部符号 __imp__glPushMatrix@0 GLWindow.obj soundCube 错误 15 错误 LNK2001:无法解析的外部符号 __imp__glRotatef@16 GLWindow.obj soundCube 错误 16 错误 LNK2001:无法解析的外部符号__imp__glBlendFunc@8无法解析的外部符号 __imp__glBegin@4 GLWindow.obj soundCube 错误 12 错误 LNK2001:无法解析的外部符号 __imp__glColor4f@16 GLWindow.obj soundCube 错误 13 错误 LNK2001:无法解析的外部符号 __imp__glPopMatrix@0 GLWindow.obj soundCube 错误 14 错误 LNK2001:无法解析的外部符号 __imp__glPushMatrix@ 0 GLWindow.obj soundCube 错误 15 错误 LNK2001:无法解析的外部符号 __imp__glRotatef@16 GLWindow.obj soundCube 错误 16 错误 LNK2001:无法解析的外部符号 __imp__glBlendFunc@8无法解析的外部符号 __imp__glBegin@4 GLWindow.obj soundCube 错误 12 错误 LNK2001:无法解析的外部符号 __imp__glColor4f@16 GLWindow.obj soundCube 错误 13 错误 LNK2001:无法解析的外部符号 __imp__glPopMatrix@0 GLWindow.obj soundCube 错误 14 错误 LNK2001:无法解析的外部符号 __imp__glPushMatrix@ 0 GLWindow.obj soundCube 错误 15 错误 LNK2001:无法解析的外部符号 __imp__glRotatef@16 GLWindow.obj soundCube 错误 16 错误 LNK2001:无法解析的外部符号 __imp__glBlendFunc@8无法解析的外部符号 __imp__glPushMatrix@0 GLWindow.obj soundCube 错误 15 错误 LNK2001:无法解析的外部符号 __imp__glRotatef@16 GLWindow.obj soundCube 错误 16 错误 LNK2001:无法解析的外部符号 __imp__glBlendFunc@8无法解析的外部符号 __imp__glPushMatrix@0 GLWindow.obj soundCube 错误 15 错误 LNK2001:无法解析的外部符号 __imp__glRotatef@16 GLWindow.obj soundCube 错误 16 错误 LNK2001:无法解析的外部符号 __imp__glBlendFunc@8
...
错误 56 致命错误 LNK1120:55 个未解析的外部 C:\Users\Simucal\Documents\Downloads\SoundCubeSrc soundCube
我在 C++ 方面没有那么有经验,但我尝试正确设置 GLUT,以便该项目可以链接到它。
我为Nate Robin 的页面下载了 GLUT32 库。
然后我将以下文件放入:
- glut.h - C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include\gl
- glut32.lib - C:\Program Files\Microsoft SDKs\Windows\v6.0A\Lib
- glut.dll - C:\Windows\System32
我还选择了项目 -> 属性 -> 链接器 -> 附加依赖项 -> 添加了“glut32.lib”
如果有人想看看我正在处理什么项目,那就在这里。
为了解决这些错误,我遗漏了哪些步骤或做错了什么?