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

来源:互联网 发布:斗地主出牌算法 编辑:程序博客网 时间:2024/06/06 23:26

在 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

1 1
原创粉丝点击