Advertisement

opengl 遇到的问题及解决办法 总结

阅读量:

'glutInit_ATEXIT_HACK': identifier not found

'glutCreateWindow_ATEXIT_HACK': identifier not found

具体原因不明,可能是版本问题

解决办法:

使用#include<gl/glut.h>之前先写用宏 #define GLUT_DISABLE_ATEXIT_HACK

vs2010/vc/include/stdlib.h(406) : warning C2381: 'exit' is redefined; __declspec(noreturn) differs from expected behavior.

vs2010/vc/platformsdk/include/gl/glut.h(146) : see declaration of 'exit'

stdlib.h和glut.h的冲突问题

因为glut和stdlib中同时定义了exit()函数,导致了冲突。

解决方法:

把include<glut.h>放在所有加载C++标准库语句的后面就可以了

全部评论 (0)

还没有任何评论哟~