简体   繁体   English

为什么我收到错误LNK1104:无法打开文件'glew32.lib'

[英]Why am I getting error LNK1104: cannot open file 'glew32.lib'

I've already read many answers that wanted to solve this issue but none of them work. 我已经阅读了很多想要解决这个问题的答案,但没有一个能够解决。 I don't think I'm missing anything: 我不认为我错过了什么:

  • Visual Studio 2013 Community Edition Visual Studio 2013社区版
  • Target = all configurations, all platforms (active = debug, Win32) Target =所有配置,所有平台(active = debug,Win32)
  • C/C++ > General > Additional Include Directories: H:\\#DEV\\OpenGL\\glew-1.12.0\\include C / C ++>常规>其他包含目录: H:\\#DEV\\OpenGL\\glew-1.12.0\\include
  • Linker > General > Additional Library Directories: H:\\#DEV\\OpenGL\\glew-1.12.0\\lib 链接器>常规>其他库目录: H:\\#DEV\\OpenGL\\glew-1.12.0\\lib
  • Linker > Input > Additional Dependencies: glew32s.lib (I also tried glew32.lib ) 链接器>输入>附加依赖项: glew32s.lib (我也尝试过glew32.lib
  • Path of both files library files (glew32.lib and glew32s.lib): H:\\#DEV\\OpenGL\\glew-1.12.0\\lib\\Release\\Win32 . 两个文件库文件的路径(glew32.lib和glew32s.lib): H:\\#DEV\\OpenGL\\glew-1.12.0\\lib\\Release\\Win32

I have permission to access the file, I didn't specify a dll since I want to use only the static version. 我有权访问该文件,因为我只想使用静态版本,所以我没有指定dll。 I also tried: 我也尝试过:

#define GLEW_STATIC

before #include and #pragma comment(linker, "/NODEFAULTLIB:libc.lib") to no avail. #include#pragma comment(linker, "/NODEFAULTLIB:libc.lib")无济于事。

Visual Studio doesn't look into the subfolders of the directories you specified in Visual Studio不会查看您指定的目录的子文件夹
Additional Library Directories . Additional Library Directories

That means that you have to add the exact path where the library is stored 这意味着您必须添加存储库的确切路径
(which would be in your case H:\\#DEV\\OpenGL\\glew-1.12.0\\lib\\Release\\Win32 ). (在你的情况下H:\\#DEV\\OpenGL\\glew-1.12.0\\lib\\Release\\Win32 )。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM