无法链接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 的文件,这个文件实 ...
随机推荐
- 希尔排序和归并排序(java实现)
希尔排序 希尔排序算法实际上是一种特殊的插入排序,由DL.Shell于1959年提出而得名. 算法思想:希尔排序使数组中任意间隔为h的元素都是有序的,这些数组称为h有序数组,对于每个h,按插入排序进行 ...
- 杭电1518 Square(构成正方形) 搜索
HDOJ1518 Square Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) ...
- Common tasks that you can perform with the Groovy Script test step
https://support.smartbear.com/readyapi/docs/soapui/steps/groovy.html Get test case object To obtain ...
- linux内socket服务器无法连接windows
今天在试socket的时候出现了一个问题:问题概述是这样的: 1.linux采用centOS7(mini)版本,虚拟机版本VMware12,网卡设置NAT 2.服务器和客户端都在windows上,通讯 ...
- 配置nginx1.8支持thinkPHP3.2 pathinfo模式
nginx 下conf/nginx.conf 或者自己的vhosts更改以前的参数 location / { root html; index index.html index.htm inde ...
- idea下使用lombok
转载 https://blog.csdn.net/u013177446/article/details/53943365 (1)pom引入依赖 <dependency> <group ...
- 关于xp操作系统下使用VC6++编写的上位机软件在win10中运行的问题
将代码拷贝到win10操作系统中,在vs2015环境中重新编译即可. 编译生成的exe出现终止时考虑mscomm控件是否注册. 当win10环境64位操作系统时,将以下四个文件放置于C:\Window ...
- MyBatis中的缓存1
1.应用程序和数据库交互的过程是一个相对比较耗时的过程 2.缓存存在的意义:让应用程序减少对数据库的访问,提升程序运行的xiaolv 3.MyBatis中默认SqlSession缓存开启 3.1 同 ...
- 如何查看Python内置模块的实现代码
方法1:使用help(random) >>> import random >>> help(random) Help on module random: NAME ...
- 2019.01.22 uoj#14. 【UER #1】DZY Loves Graph(并查集)
传送门 题意简述: 要求支持以下操作: 在a与b之间连一条长度为i的边(i是操作编号):删除当前图中边权最大的k条边:表示撤销第 i−1次操作,保证第1次,第i−1 次不是撤回操作. 要求在每次操作后 ...