vs2010+win7(64)无法链接glew的解决办法
2015-01-04 04:39
197 查看
最近接触glew,但是,下了几个文件都没有办法链接,老是出现下面的错误
上网找了很多方法,基于解决我的问题,在此,我也总结一下链接失败的一些解决方法:
方法1:自己编译,这种方法,最后编译生成的文件拷贝到相应文件夹
方法2:更改代码,或者采取其他连接方式
以上两种方法,我都进行了尝试,可是都没有得到解决,但是,我尝试了在#include <GL/glew.h>前面加上#define GLEW_STATIC,编译之后,得到了新的错误提示:
我检查了自己的lib文件的链接还有附加库的目录都没有问题,后来在一个国外网站找到了解决的办法:
You have now set up the project to include the appropriate headers and build against the correct libraries. These particular instructions will treat GLEW and GLUT as "dynamically linked" libraries.
This means that you will have to distribute the glut32.dll and glew32.dll files along with your program for users without GLUT and GLEW installed. GLEW gives you the option of "static linking," which allows you to avoid redistributing glew32.dll. To do this,
#define GLEW_STATIC before the #include <GL/glew.h> line. Also choose to link against glew32s.lib instead of glew32.lib.
按照他的说法,我尝试了把glew32.lib改为glew32s.lib(前提,你要把glew32s.lib已经拷贝到了lib文件夹下面),还有要把链接器->常规里面的附加库的目录设为glew32s.lib所在的文件夹
点击调试,ok!!!
弄了一天,终于搞定了。
所以,增加一个方法
方法3:就是把glew32.lib改为glew32s.lib,把链接器->常规里面的附加库的目录设为glew.lib所在的文件夹,在#include
<GL/glew.h>前面加上#define GLEW_STATIC
1>main.obj : error LNK2019: 无法解析的外部符号 __imp__glewGetString@4,该符号在函数 _init 中被引用 1>main.obj : error LNK2019: 无法解析的外部符号 __imp__glewInit@0,该符号在函数 _init 中被引用 1>Release\gpu_sph.exe : fatal error LNK1120: 2 个无法解析的外部命令
上网找了很多方法,基于解决我的问题,在此,我也总结一下链接失败的一些解决方法:
方法1:自己编译,这种方法,最后编译生成的文件拷贝到相应文件夹
方法2:更改代码,或者采取其他连接方式
以上两种方法,我都进行了尝试,可是都没有得到解决,但是,我尝试了在#include <GL/glew.h>前面加上#define GLEW_STATIC,编译之后,得到了新的错误提示:
<span style="font-size:14px;">1>gpu_util.obj : error LNK2001: 无法解析的外部符号 ___glewMultiTexCoord1fARB 1>gpu_util.obj : error LNK2001: 无法解析的外部符号 ___glewMultiTexCoord2fARB 1>gpu_util.obj : error LNK2001: 无法解析的外部符号 ___wglewGetPbufferDCARB 1>gpu_util.obj : error LNK2001: 无法解析的外部符号 ___wglewCreatePbufferARB 1>gpu_util.obj : error LNK2001: 无法解析的外部符号 ___wglewChoosePixelFormatARB 1>gpu_util.obj : error LNK2001: 无法解析的外部符号 ___wglewBindTexImageARB 1>gpu_util.obj : error LNK2001: 无法解析的外部符号 ___glewActiveTextureARB 1>main.obj : error LNK2001: 无法解析的外部符号 ___glewActiveTextureARB 1>main.obj : error LNK2019: 无法解析的外部符号 _glewGetString@4,该符号在函数 _init 中被引用 1>main.obj : error LNK2019: 无法解析的外部符号 _glewInit@0,该符号在函数 _init 中被引用 1>Release\gpu_sph.exe : fatal error LNK1120: 9 个无法解析的外部命令</span>
我检查了自己的lib文件的链接还有附加库的目录都没有问题,后来在一个国外网站找到了解决的办法:
You have now set up the project to include the appropriate headers and build against the correct libraries. These particular instructions will treat GLEW and GLUT as "dynamically linked" libraries.
This means that you will have to distribute the glut32.dll and glew32.dll files along with your program for users without GLUT and GLEW installed. GLEW gives you the option of "static linking," which allows you to avoid redistributing glew32.dll. To do this,
#define GLEW_STATIC before the #include <GL/glew.h> line. Also choose to link against glew32s.lib instead of glew32.lib.
按照他的说法,我尝试了把glew32.lib改为glew32s.lib(前提,你要把glew32s.lib已经拷贝到了lib文件夹下面),还有要把链接器->常规里面的附加库的目录设为glew32s.lib所在的文件夹
点击调试,ok!!!
弄了一天,终于搞定了。
所以,增加一个方法
方法3:就是把glew32.lib改为glew32s.lib,把链接器->常规里面的附加库的目录设为glew.lib所在的文件夹,在#include
<GL/glew.h>前面加上#define GLEW_STATIC
相关文章推荐
- vs2010+win7(64)无法链接glew的解决办法
- 无法链接glew的解决办法
- iTunes更新后,提示无法定位程序输入点sqlite3-wal-checkpoint于动态链接库sqlite3.dll上"的解决办法
- wamp win7 64无法加载php_curl解决办法
- 遇到“ora-12514 tns 监听程序当前无法识别链接描述符中请求的服务”,解决办法
- wordpress修改固定链接之后 无法访问的解决办法
- Windows XP下IE网页无法正常显示与无法打开新链接的部分解决办法
- virtualbox无法创建64虚拟机的解决办法
- mysql-5.7.9-winx64 MySQL服务无法启动,服务没有报告任何错误 的解决办法
- eCos系统无法正确链接到在C++源文件中自定义的cyg_user_start函数的问题和解决办法
- mysql-5.7.9-winx64 MySQL服务无法启动,服务没有报告任何错误的解决办法
- vc, vs2005 中无法链接strcasecmp 和 strncasecmp的解决办法
- 关于邮件中链接无法打开或直接定向主页的解决办法
- vc, vs2005 中无法链接strcasecmp 和 strncasecmp的解决办法
- Linux下链接文件使用rm无法删除的解决办法
- APR lib 链接出现”error LNK2019: 无法解析的外部符号 __imp__apr_initialize“ 解决办法
- 有关百度一键分享链接到微信朋友圈无法打开网页,报404错误的解决办法,from=timeline&isappinstalled=0,和伪静态规则有关
- WordPress中修改固定链接导致无法显示文章内容的问题的解决办法
- 无法定位程序输入点ldrlockloaderlock于动态链接库ntdll.dll上的解决办法