函数_main(OPENGL C++)中引用的未解析的外部符号_____________
Posted
技术标签:
【中文标题】函数_main(OPENGL C++)中引用的未解析的外部符号_____________【英文标题】:unresolved external symbol _____________ referenced in function _main (OPENGL C++) [duplicate] 【发布时间】:2020-05-17 06:27:08 【问题描述】:所以我正在关注这个关于 OpenGL for C++ 的教程,并关注了这个人所做的一切。我收到了这些错误,但我不知道如何修复它们。
Severity Code Description Project File Line Suppression State
Error LNK2019 unresolved external symbol _glfwWindowShouldClose referenced in function _main GameEngine C:\Users\Layne\source\repos\GameEngine\GameEngine\main.obj 1
Error LNK1120 9 unresolved externals GameEngine C:\Users\Layne\source\repos\GameEngine\Debug\GameEngine.exe 1
Warning LNK4272 library machine type 'x64' conflicts with target machine type 'x86' GameEngine C:\Users\Layne\source\repos\GameEngine\Game Engine\GLFW\lib\glfw3.lib 1
Error LNK2019 unresolved external symbol _glfwCreateWindow referenced in function _main GameEngine C:\Users\Layne\source\repos\GameEngine\GameEngine\main.obj 1
Error LNK2019 unresolved external symbol _glfwInit referenced in function _main GameEngine C:\Users\Layne\source\repos\GameEngine\GameEngine\main.obj 1
Error LNK2019 unresolved external symbol _glfwMakeContextCurrent referenced in function _main GameEngine C:\Users\Layne\source\repos\GameEngine\GameEngine\main.obj 1
Error LNK2019 unresolved external symbol _glfwPollEvents referenced in function _main GameEngine C:\Users\Layne\source\repos\GameEngine\GameEngine\main.obj 1
Error LNK2019 unresolved external symbol _glfwSetFramebufferSizeCallback referenced in function _main GameEngine C:\Users\Layne\source\repos\GameEngine\GameEngine\main.obj 1
Error LNK2019 unresolved external symbol _glfwSwapBuffers referenced in function _main GameEngine C:\Users\Layne\source\repos\GameEngine\GameEngine\main.obj 1
Error LNK2019 unresolved external symbol _glfwTerminate referenced in function _main GameEngine C:\Users\Layne\source\repos\GameEngine\GameEngine\main.obj 1
Error LNK2019 unresolved external symbol _glfwWindowHint referenced in function _main GameEngine C:\Users\Layne\source\repos\GameEngine\GameEngine\main.obj 1
【问题讨论】:
【参考方案1】:警告 LNK4272 库机器类型“x64”与目标机器类型“x86”GameEngine 冲突
听起来您的库是用 64 位构建的,但您是用 32 位构建的?如果您使用的是 Visual Studio,则可以在顶部进行更改。否则,请告诉我们您正在开发的平台和 IDE,并请提供您正在学习的教程的链接。
【讨论】:
我试试看。这是该系列的链接:youtube.com/… 它可能是 x64 的库之一。其余的是x86。我想知道它是什么以上是关于函数_main(OPENGL C++)中引用的未解析的外部符号_____________的主要内容,如果未能解决你的问题,请参考以下文章