我有glew版本1.9.0,我已经将所有头文件放在MSVS包含目录中,所有lib文件放在lib文件夹中。然后,我将dll放入sysWOW64文件夹中,并在项目属性下的附加依赖项中添加了所需的所有库:
但是,我得到了一个链接错误。
错误1错误LNK2019:函数_main C中引用的未解析外部符号_glewInit@0:\_main\x\文档\visual studio 2013\Projects\openGLTest\openGLTest\main.obj openGLTest
发布于 2014-06-12 02:13:50
首先,不应将DLL放置到sysWOW64或任何其他操作系统拥有的目录(如System32 )中。也就是说,这与您放置DLL的位置无关,与链接到的库(或者更确切地说没有链接到)有关。
您也不应该链接到4种不同的GLEW配置:
链接到的最佳库通常是glew32s.lib,因为它首先否定了DLL的需要,但随后需要在#include "glew.h"之前添加DLL。
在MSVC中,您可以将以下内容添加到源文件中,以便同时处理所有这些事情的:
#pragma comment (lib, "glew32s.lib")
#define GLEW_STATIC
#include "glew.h"发布于 2016-12-06 05:29:24
我找到了这个问题的解决方案,这里
1. Right click on your `project > Properties > Configuration > C/C++ > General > Additional Include Directories`
2. On the right dropdown, click `<Edit...>`
3. `Additional Inclue Directories` has appeared
4. Click the `new line icon > browse button` then select the glew include folder: `$(your path to glew)\glew-1.12.0\include`1. Right click on your project `> Properties > Configuratio Properties > Linker > General > Additional Library Directories`
2. Click `<Edit...>`
3. `Additional Library Directories` has appeared
4. **For the 64-bit version**: add `$(your path to glew)\glew-1.12.0\lib\Release\x64`
5. **For 32-bit version**: add `$(your path to glew)\glew-1.12.0\lib\Release\Win32`
6. Right click on your project (again) `>Properties > Configuration Properties > Linker > Input > Additional Dependencies`
7. Click `<Edit..>`
8. `Additional Dependencies` window has appeared
9. Click the white area and write `glew32.lib`https://stackoverflow.com/questions/24175420
复制相似问题