GLFW(x64)存在轻微问题 我目前正致力于将一些应用程序转换成C++,为此我决定使用OpenGL,因为我从其他平台上得到了一些经验。 但是要在x64中编译它似乎是相当麻烦的。为了检查我的链接功能是否正常工作,我正在尝试编译本教程:

GLFW(x64)存在轻微问题 我目前正致力于将一些应用程序转换成C++,为此我决定使用OpenGL,因为我从其他平台上得到了一些经验。 但是要在x64中编译它似乎是相当麻烦的。为了检查我的链接功能是否正常工作,我正在尝试编译本教程:,c++,opengl,glew,glfw,lnk2019,C++,Opengl,Glew,Glfw,Lnk2019,但正如你所看到的,我失败得很惨。我已下载并安装: 免费供应 GLM GLFW 格洛 这个问题显然在GLFW内部。我使用Visual Express C++ 2010。< /P> 我是这样安装GLFW的: GLFW.dll(System32) glfw.h(C:\Program Files\Microsoft SDK\Windows\v7.1\Include\gl) GLFW.lib(C:\Program Files\Microsoft SDK\Windows\v7.1\lib\x64) G

但正如你所看到的,我失败得很惨。我已下载并安装:

  • 免费供应
  • GLM
  • GLFW
  • 格洛
这个问题显然在GLFW内部。我使用Visual Express C++ 2010。< /P> 我是这样安装GLFW的:

  • GLFW.dll(System32)
  • glfw.h(C:\Program Files\Microsoft SDK\Windows\v7.1\Include\gl)
  • GLFW.lib(C:\Program Files\Microsoft SDK\Windows\v7.1\lib\x64)
  • GLFWDLL.lib(C:\Program Files\Microsoft SDK\Windows\v7.1\lib\x64)
我的链接器:

kernel32.lib;glu32.lib;glew32.lib;GLFW.lib;GLFWDLL.lib;opengl32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)
输出:

1>------ Build started: Project: Spacecraft, Configuration: Debug x64 ------
1>  Main.cpp
1>Main.obj : error LNK2019: unresolved external symbol __imp_glfwGetWindowParam referenced in function main
1>Main.obj : error LNK2019: unresolved external symbol __imp_glfwGetKey referenced in function main
1>Main.obj : error LNK2019: unresolved external symbol __imp_glfwSwapBuffers referenced in function main
1>Main.obj : error LNK2019: unresolved external symbol __imp_glfwEnable referenced in function main
1>Main.obj : error LNK2019: unresolved external symbol __imp_glfwSetWindowTitle referenced in function main
1>Main.obj : error LNK2019: unresolved external symbol __imp_glfwTerminate referenced in function main
1>Main.obj : error LNK2019: unresolved external symbol __imp_glfwOpenWindow referenced in function main
1>Main.obj : error LNK2019: unresolved external symbol __imp_glfwOpenWindowHint referenced in function main
1>Main.obj : error LNK2019: unresolved external symbol __imp_glfwInit referenced in function main
1>c:\users\leif andreas\documents\visual studio 2010\Projects\Spacecraft\x64\Debug\Spacecraft.exe : fatal error LNK1120: 9 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
最后,我的建议包括:

// Include standard headers
#include <stdio.h>
#include <stdlib.h>

// Include GLEW
#include <gl/glew.h>
#include <gl/glut.h>

// Include GLFW
#include <gl/glfw.h>

// Include GLM
#include <glm/glm.hpp>
using namespace glm;
//包括标准头
#包括
#包括
//包括GLEW
#包括
#包括
//包括GLFW
#包括
//包括GLM
#包括
使用名称空间glm;

可能会有帮助。谢谢,但我不确定这是否是解决方案,输出指向glfw。在第4.2.2节的
readme.html
中编写了如何更正链接GLFW:要编译使用GLFW的DLL版本的程序,需要定义GLFW_DLL常量。这可以通过编译器开关来完成,通常是通过将-DGLFW_DLL添加到编译器选项列表中。您还可以在包含GLFW.h之前,将以下行添加到所有包含GLFW.h的源文件中:#define GLFW_DLL。谢谢,尝试了,但仍然返回相同的错误!可能是glfw不支持vc10编译器的x64吗?您使用的glfw版本是什么?我找到了指向哪一点。因此,GLFW 3.0中提供了Windows 64位支持。