1

我目前正在努力将我的一些应用程序转换为 C++,为此我决定使用 openGL,因为我从其他平台获得了一些使用它的经验。但是让它在 x64 中编译似乎很麻烦。要检查我的链接是否正常工作,我只是想编译本教程:

http://www.opengl-tutorial.org/beginners-tutorials/tutorial-1-opening-a-window/

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

  • 自由过剩
  • GLM
  • GLFW
  • GLEW

这个问题显然存在于 GLFW 内部。我正在使用 Visual express c++ 2010。

我这样安装 GLFW:

  • GLFW.dll (System32)
  • glfw.h (C:\Program Files\Microsoft SDKs\Windows\v7.1\Include\gl)
  • GLFW.lib (C:\Program Files\Microsoft SDKs\Windows\v7.1\Lib\x64)
  • GLFWDLL.lib (C:\Program Files\Microsoft SDKs\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;
4

0 回答 0