Visual Studio : 从 win32 更改为 x64 时,显示链接错误

Visual Studio : when changed from win32 to x64, its showing linking error

我的代码在基于 win32 时工作正常 application.Recently 我将其更改为 x64 出现错误并显示 "cannot open glut32.lib"。然后我在其他依赖项上添加了 glut32.lib 但是现在出现这些链接错误。

1>Linking... 1>dispfunc.obj : error LNK2019: unresolved external symbol glutSwapBuffers referenced in function "void __cdecl Display(void)" (?Display@@YAXXZ)

1>init.obj : error LNK2019: unresolved external symbol glutTimerFunc referenced in function "void __cdecl Timer(int)" (?Timer@@YAXH@Z)

1>init.obj : error LNK2019: unresolved external symbol glutKeyboardFunc referenced in function "void __cdecl Timer(int)" (?Timer@@YAXH@Z)

您现在需要 link 针对 64 位版本的 glut 库,freeglut 有一个可用的 64 位库,您可以下载 here。获取freeglut 3.0.0 MSVC包,使用freeglut/lib/x64文件夹中的freeglut.lib

此外,如果您还没有将您在 32 位设置中更改的所有属性复制到 64 位设置,请不要忘记将其复制到 64 位设置中。