visual-studio-2012 - 设置 GLEW、FREEGLUT

标签 visual-studio-2012 glut windows-7-x64 glew freeglut

我正在 Windows7 64 位上为 Visual Studio2012 设置 FREEGLUT 和 GLEW。 首先,我还需要设置 GLUT 吗?

第二,我很困惑,在 GLEW/lib 和 GLEW/bin 中都有 Release 和 Release MX 文件夹,我应该选择哪一个文件?

最佳答案

关于 GLEW:

我建议您暂时使用 GLEW,当您需要 GLEW MX(M多渲染内容xts)提供的附加功能时,请切换到它。

根据http://glew.sourceforge.net/advanced.html

Starting with release 1.2.0, thread-safe support for multiple rendering contexts, possibly with different capabilities, is available. Since this is not required by most users, [GLEW MX] is not added to the binary releases to maintain compatibility between different versions.

以下是构建 glew 的方法:

Note: Just because you are using a 64 bit machine, doesn't mean that you have Visual Studio set up to run 64 bit applications. I suggest you use the 32 bit versions of libraries until you are ready to reap the benefits of using the 64 bit versions, as you can switch later.

1. 将您的项目与 lib 文件夹中的静态 GLEW 库链接。这是 glew32s.lib 或 GLEW,具体取决于您的平台。

Note: glew32s.lib is to link statically, glew32.lib (without the s) is to link dynamically.

If you prefer to dynamically link with GLEW instead, leave out the define and link with glew32.lib instead of glew32s.lib on Windows. Don't forget to include glew32.dll or libGLEW.so with your executable!

Linker - Additional Library Directories Linker - Input - Additional Dependencies

2.include 文件夹添加到包含路径中。

C C++ - General - Additional Include Directories

3. 在程序中包含该 header ,但请确保将其包含在 OpenGL header 或用于创建窗口的库之前。

Code - Headers

关于过剩:

其他人可以回答(或编辑我的答案)吗,因为我还没有使用过 GLUT。

用于此答案的其他来源:

https://open.gl/

关于visual-studio-2012 - 设置 GLEW、FREEGLUT,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18969638/

相关文章:

c++ - 错误 LNK2019 : unresolved external symbol

iis - 该服务此时无法接受控制消息

c - 奇怪的/fp 浮点模型标志行为

c# - 添加 "winmd"引用与添加项目引用

opengl - 重新调整后对整个场景进行抗锯齿处理

c++ - 像素在自行初始化时移动,但不在循环中移动?

c++ - 如何在 Cygwin 中使用 OpenGL 和 GLUT

python - 如何让 easy_install.exe 不在单独的窗口中打开?

sql-server - SQL Server 2008 Management Studio 打开文件对话框没有响应

visual-studio-2012 - 从我的模板创建新项目时收到错误消息