无法链接glew的解决办法-编译开源库出现: error LNK2001: 无法解析的外部符号
无法链接glew的解决办法-编译开源库出现: error LNK2001: 无法解析的外部符号
参考官方配置指南:http://glew.sourceforge.net/install.html
1. 编译build开源库中,引入了gluw, 正常引入:.h, .lib .dll 文件后,出现下列错误
<span style="font-size:14px;">>gpu_util.obj : error LNK2001: 无法解析的外部符号 ___glewMultiTexCoord1fARB
>gpu_util.obj : error LNK2001: 无法解析的外部符号 ___glewMultiTexCoord2fARB
>gpu_util.obj : error LNK2001: 无法解析的外部符号 ___wglewGetPbufferDCARB
>gpu_util.obj : error LNK2001: 无法解析的外部符号 ___wglewCreatePbufferARB
>gpu_util.obj : error LNK2001: 无法解析的外部符号 ___wglewChoosePixelFormatARB
>gpu_util.obj : error LNK2001: 无法解析的外部符号 ___wglewBindTexImageARB
>gpu_util.obj : error LNK2001: 无法解析的外部符号 ___glewActiveTextureARB
>main.obj : error LNK2001: 无法解析的外部符号 ___glewActiveTextureARB
>main.obj : error LNK2019: 无法解析的外部符号 _glewGetString@,该符号在函数 _init 中被引用
>main.obj : error LNK2019: 无法解析的外部符号 _glewInit@,该符号在函数 _init 中被引用
>Release\gpu_sph.exe : fatal error LNK1120: 个无法解析的外部命令</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, 采用静态连接, 这样可以避免,将glew32.dll , glut32.dll动态库同程序一起发布。
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!!!
弄了一天,终于搞定了。
所以,增加一个方法
另一个方法:就是把glew32.lib改为glew32s.lib,把链接器->常规里面的附加库的目录设为glew.lib所在的文件夹,在#include <GL/glew.h>前面加上#define GLEW_STATIC
无法链接glew的解决办法-编译开源库出现: error LNK2001: 无法解析的外部符号的更多相关文章
- C++工程编译之“error LNK2001: 无法解析的外部符号”
今天一整天都在折腾“error LNK2001: 无法解析的外部符号”,就在头疼不已的时候,总算是找到问题原因了:各个动态链接库的编译方式必须统一才行,要不然很容易对库函数的引用产生冲突.简单来说就是 ...
- c++中调用python脚本提示 error LNK2001: 无法解析的外部符号 __imp_Py_Initialize等错误的解决方法
最近项目中需要实现一个服务器宕机后短信提醒的功能,个人觉得在使用Python 写http请求这块很方便,发短信这块就使用了python,但是c++程序中调用这个脚本时,编译不通过,提示如下错误: er ...
- vs2015编译ffmpeg 出现错误rtmp.lib(rtmp.obj) : error LNK2001: 无法解析的外部符号 ___iob_func
vs2015编译ffmpeg(版本3.0.2)引用外部库文件librtmp出现以下错误: rtmp.lib(rtmp.obj) : error LNK2001: 无法解析的外部符号 __imp__st ...
- gSoap的“error LNK2001: 无法解析的外部符号 _namespaces”解决方法
错误 2 error LNK2001: 无法解析的外部符号 _namespaces 解决方法: 1. 在工程中定义 WITH_NONAMESPACES 宏 2.尝试 "#include &q ...
- 引用rtmp编译报错:rtmp.obj : error LNK2001: 无法解析的外部符号 __imp__timeGetTime@0
如题vs下引用librtmp的时候报错:rtmp.obj : error LNK2001: 无法解析的外部符号 __imp__timeGetTime@0 在link 里加入 winmm.lib 就可以 ...
- vs2010+qt4编译出现error LNK2001: 无法解析的外部符号 "public: virtual struct QMetaObject等错误
1.当vs2010编译qt时会出现以下错误: 1>------ 已启动全部重新生成: 项目: MyDialog, 配置: Debug Win32 ------ 1>生 ...
- error LNK2001: 无法解析的外部符号 解决方法
错误提示:LNK2001 无法解析的外部符号 "public: class el::base::Writer & __cdecl el::base::Writer::construc ...
- Error LNK2001 无法解析的外部符号 的几种情况及解决办法
最近遇到的关于VS里编译出现的“无法解析的外部符号”问题,在网上寻求解决办=办法时查到下面的博客内容,作者讲解的挺全面的,作为收藏以备将来查询. 原文http://blog.csdn.net/shen ...
- gSoap的 “error LNK2001: 无法解析的外部符号 _namespaces”解决方法
gSoap是C/C++开发webService服务第三方的公开类库. 出现上述错误是因为缺少必要的头文件导致的. 在用wsdl2h生成头文件的时候,一并生成了类似 xx.nsmap 的文件,这个文件实 ...
随机推荐
- Numpy 索引
1.一维索引 >>> import numpy as np >>> A = np.arange(3,15) >>> print(A[3]) 6 & ...
- Android.Tools.Ant
ant 1. ant手册翻译 ant手册翻译是一项大工程!!!!!! ant在线手册的链接好不明确. 2. ant 支持for循环 安装ant-contrib Ref[1.1]. 要在ant的buil ...
- 三分钟分布式CAP理论
分布式系统架构理论,定义了三种指标,理论说我们最多只能满足两个. ## 分布式系统 首先我们这个理论所说的分布式系统,是指系统内会共享数据,互相有连接有交互,才能完成系统功能的的分布式系统.而这个理论 ...
- C单链表操作
#include <stdio.h> #include <stdlib.h> #define ElemType int #define Status int #define O ...
- VS Installer教程
本文主要讲解利用VS2010下的Visual Studio Installer打包Zigbee程序(VS2010编写)的过程. 1.打开Zigbee程序,在解决方案中添加“新建项目”-->其他项 ...
- APM浅析
APM(Application Performance Management & Monitoring)一种基于云的性能监控服务(SaaS),以非侵入式监听探针,收集应用关键指标,生成分析报表 ...
- 大神你好,可以帮我P张图吗?
韩国版的求大神帮我P张图,看得有点下巴脱臼啊!哈哈哈哈哈哈哈~ 感觉照片拍得很尴尬,请大神P得更有动感 拍了跳跃照片,但内衣露出来一点,能帮忙去掉吗 不喜欢没穿制服的样子,请帮忙加上制服 希望背景 ...
- Sketch 和 PS中的设计图如何实现“自动切图”?
切图是很多UI设计师的一项日常工作.平时做完设计图,要将设计稿切成便于制作成页面的图片,并标注好尺寸和间距,交付给前端来完成html+css布局的静态页面,有利于交互,形成良好的视觉感. 但有的认为前 ...
- 微信小程序bug
2017-11-21 微信movable-view有bug,它不能在style里面设置z-index,一旦设置了,不是层间的元素就会有干扰,比如我移动0层的movable-view,但是1层的mova ...
- pkg_resources.DistributionNotFound: The 'catkin-pkg==0.4.9' distribution was not found
个人感觉是python2与python3在ros中的差异导致的, 问题一:Traceback (most recent call last): File "/usr/bin/rosdep& ...