您的位置:首页 > 其它

unresolved external symbol __imp____glutInitWithExit

2016-01-15 18:28 423 查看
Error 1 error LNK2001: unresolved external symbol __imp____glutInitWithExit@12 opengltest.obj opengltest

Error 2 error LNK2001: unresolved external symbol __imp____glutCreateWindowWithExit@8 opengltest.obj opengltest

Error 3 fatal error LNK1120: 2 unresolved externals

后来去h文件找到这样一条信息:

Note that the __glut*WithExit routines should NEVER be called directly.

To avoid the atexit workaround, #define GLUT_DISABLE_ATEXIT_HACK

因此在#include glut.h之前加入:

#define GLUT_DISABLE_ATEXIT_HACK
编译通过,运行ok。

后来又在网上验证了大家使用了同一解决方法。

如:

点击打开链接
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: