FreeGLUT Tips: Resolve compile issue: error LNK1104: cannot open file 'freeglutd.lib'

在 Visual C++工程文件中引用了FreeGLUT,结果编译是出现了这个错误:

error LNK1104: cannot open file 'freeglutd.lib'

在opengl.org网站的论坛里找到了答案:https://www.opengl.org/discussion_boards/showthread.php/186328-error-link-1104

Hey man I don't know if you're still having this error but I was running into it 
as well and it pretty much ate up a couple hours. Pretty much the "freeglutd.lib" 
has to do with debugging, hence the "d" on the end, so what I did was go into the: 
Properties > C/C++ > Preprocessor > Preprocessor Definitions and type NDEBUG. What 
this does is in the "freeglut_std.h" there is a ifdef for NDEBUG that if it is 
defined then use "freeglut.lib" otherwise it's going to use the "freeglutd.lib". 
So by defining it in the Preprocessor Definitions, you are now 
using the "freeglut.lib". Hopefully this helps you out!

解决办法是这样的:

更改 Visual C++工程项目属性,在 C/C++ | Preprocessor | Preprocessor Definitions 的设置中,增加一个宏定义 NDEBUG 即可:

NDEBUG

C/C++ -> Preprocessor -> Preprocessor Definitions

  • 3
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值