Visual Studio 11 GLFW外部符号错误 [英] Visual Studio 11 GLFW external symbol error

查看:2469
本文介绍了Visual Studio 11 GLFW外部符号错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的基本代码是从 http://www.glfw.org/documentation.html的例子

The basic code I use is the example from http://www.glfw.org/documentation.html

我得到这个输出:

1>------ Build started: Project: ConsoleApplication1, Configuration: Debug Win32 ------
1>  Quelle.cpp
1>Quelle.obj : error LNK2019: unresolved external symbol _glfwInit referenced in function _main
1>Quelle.obj : error LNK2019: unresolved external symbol _glfwTerminate referenced in function _main
1>Quelle.obj : error LNK2019: unresolved external symbol _glfwCreateWindow referenced in function _main
1>Quelle.obj : error LNK2019: unresolved external symbol _glfwWindowShouldClose referenced in function _main
1>Quelle.obj : error LNK2019: unresolved external symbol _glfwPollEvents referenced in function _main
1>Quelle.obj : error LNK2019: unresolved external symbol _glfwMakeContextCurrent referenced in function _main
1>Quelle.obj : error LNK2019: unresolved external symbol _glfwSwapBuffers referenced in function _main
1>C:\Users\MICHAEL\documents\visual studio 2012\Projects\ConsoleApplication1\Debug\ConsoleApplication1.exe : fatal error LNK1120: 7 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

glfw3.h位于VC / include目录中。
我还添加了glfw3.lib到VC / lib文件夹和我加了glfw3.lib作为一个额外的依赖于连接器的输入,但我仍然得到这个错误。

The glfw3.h is in the VC/include directory. I've also added the glfw3.lib to the VC/lib folder and I added the glfw3.lib as an additional dependency to the linker input but I still get this errors.

任何想法为什么?我已经使用了预编译的二进制(支持MSVC2012和64倍) http://www.glfw.org/download .html

Any Idea why? I've used the precompiled binaries (which support MSVC2012 and 64x) http://www.glfw.org/download.html

推荐答案

好的,经过非常多的尝试和错误,我解决了。

Ok, after very much trial and error I solved it.


  1. 使用32位二进制文​​件

  2. 右键单击项目 - >属性 - > VC ++

  3. 包含目录:C:\Users\MICHAEL\Desktop\glfw-3.0.3.bin.WIN32\include; $(INCLUDEPATH)

  4. 库目录:C:\Users\MICHAEL\Desktop\glfw- 3.0.3.bin.WIN32\lib-msvc110; $(LibraryPath)

  5. 链接器 - >输入 - >其他依赖关系添加

  6. glfw3.lib和opengl32.lib

  1. Use the 32-bit binaries
  2. Right click on the project -> Properties -> VC++
  3. Include Directories: C:\Users\MICHAEL\Desktop\glfw-3.0.3.bin.WIN32\include;$(IncludePath)
  4. Library Directories: C:\Users\MICHAEL\Desktop\glfw-3.0.3.bin.WIN32\lib-msvc110;$(LibraryPath)
  5. Linker -> Input -> Additional Dependencies add
  6. glfw3.lib and opengl32.lib

这篇关于Visual Studio 11 GLFW外部符号错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆