提问人:NotFamous 提问时间:2/24/2021 最后编辑:NotFamous 更新时间:2/24/2021 访问量:945
Visual Studio 19 GLFW 外部符号错误
Visual studio 19 GLFW external symbol error
问:
我使用 https://www.glfw.org/documentation.html
出现这些错误的 GLFW 示例
Build started...
1>------ Build started: Project: generic RPG game, Configuration: Debug x64 ------
1>main.cpp
1>LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
1>main.obj : error LNK2019: unresolved external symbol __imp_glClear referenced in function main
1>C:\Users\Joseph\Desktop\foldrr\generic RPG game\x64\Debug\generic RPG game.exe : fatal error LNK1120: 1 unresolved externals
1>Done building project "generic RPG game.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
我也包括了glfw3.lib和标头
我使用 x64 Windows 预编译二进制文件 3.3.2 版(截至目前的最新版本)
如果我在示例代码中注释掉函数,错误就会消失,我能够正常编译,并且通过删除函数中的参数,我得到一个错误glClear(GL_COLOR_BUFFER_BIT);
GL_COLOR_BUFFER_BIT
'glClear': function does not take 0 arguments
此外,如果我注释掉函数并尝试呈现简单的三角形,我也会出现错误
1>main.obj : error LNK2019: unresolved external symbol __imp_glBegin referenced in function main
1>main.obj : error LNK2019: unresolved external symbol __imp_glVertex2f referenced in function main
我知道以前有人问过类似的问题,但我没有发现任何人有这种奇怪的行为
答: 暂无答案
评论