Visual Studio 2012 - 错误LNK1104:无法打开文件'glew32.lib' [英] Visual Studio 2012 - error LNK1104: cannot open file 'glew32.lib'

查看:14923
本文介绍了Visual Studio 2012 - 错误LNK1104:无法打开文件'glew32.lib'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到问题编译一个基本的openGL程序在VS 2012。我收到一个构建错误compiltation给我:

I am having issues compiling a basic openGL program on VS 2012. I get a build error upon compiltation giving me:

1>LINK : fatal error LNK1104: cannot open file 'glew32.lib'


在您的OpenGL项目中打开Project - > Properties - > Configuration Properties - > Linker - > Input - >附加依赖关系 - > add glew32.lib。

In your OpenGL project open Project -> Properties -> Configuration Properties -> Linker -> Input -> Additional Dependencies -> add glew32.lib.

此外,您必须在源中包含#include;对于你的glew文件夹的添加路径:项目 - >属性 - >配置属性 - >常规 - > VC ++目录 - >包括目录和库目录;

Also you must include #include in your sources; For that add path to your glew folder: Project -> Properties -> Configuration Properies -> General -> VC++ Directories -> Include Directories and Library Directories;

C / C ++标签 - >常规 - >其他包括目录 - 添加lib文件夹

C/C++ Tab -> General -> Additional Include Directories - Add lib folder there

我还将glew32.dll添加到我的Debug文件夹我的项目文件夹以及可执行文件。到目前为止,我一直收到这个错误。

I have also added the glew32.dll onto my Debug folder within my project folder along with the executable. So far I keep getting this error.

如果您需要进一步澄清我所做的步骤,请不要犹豫问

推荐答案

总之,使用glew的dll版本没有真正的好处

In all honesty, there is no real benefit to using the DLL version of glew (short of reduced executable size, but this hardly matters on modern Windows PCs).

这不是你可以简单地将一个新版本的DLL放入你的应用程序,并使用以前从未使用过的扩展。同样,对于基本上只解析扩展规范的库,错误修复非常罕见/不必要。使用DLL作为固定扩展加载错误在装运软件的手段的文件也不实用。从长远来看,静态链接到glew(这意味着 glew32s.lib )更有意义。

It is not like you can simply drop a new version of the DLL into your application and use extensions that you never used before. Likewise, bug fixes are so infrequent/unnecessary with a library that basically just parses the extension spec. files that using the DLL as a means of fixing extension loading bugs in shipped software is also not practical. Statically linking to glew (this means glew32s.lib) makes much more sense in the long run.

链接库在Windows上也更加可移植,它将与MSVC和MinGW(而DLL库只适用于MSVC)一起工作。链接 glew32s ,并把它放在你决定用于附加库依赖的任何目录。



这是我写的使用glew的项目的一个示例解决方案配置。我已经为这种特定软件建立了约定,其中编译时依赖性存储在 platform /< Subsystem> 下。因此,我在 glew32s.lib (32位)和 glew64s.lib > ./ Epsilon / platform / OpenGL / glew {32 | 64} s.lib

The static linking library is also more portable on Windows, it will work with MSVC and MinGW (whereas the DLL library only works with MSVC). Link against glew32s and put that in whatever directory you decided to use for additional library dependencies.


Here is a sample solution configuration for a project I wrote that uses glew. I have established a convention for this particular software where compile-time dependencies are stored under platform/<Subsystem>. Thus, I have glew32s.lib (32-bit) and glew64s.lib (64-bit) in ./Epsilon/platform/OpenGL/glew{32|64}s.lib

  

  

这篇关于Visual Studio 2012 - 错误LNK1104:无法打开文件'glew32.lib'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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