如何在 Visual C++ Express Edition 中使用 GLUT(OpenGL 实用工具库) 编译 OpenGL 应用程序的基本步骤是什么?
如何在 Visual C++ Express Edition 中使用 GLUT(OpenGL 实用工具库) 编译 OpenGL 应用程序的基本步骤是什么?
现在使用GLUT或OpenGL的程序应该能够在Visual C++ Express Edition下编译了。
exit()
重新定义的错误。如果您看到此错误,有两种可能的解决方法:
glut.h
中的exit()
原型替换为您的stdlib.h
中的原型,以使它们匹配。这可能是最好的解决方案。#include <gl/glut.h>
之前定义#define GLUT_DISABLE_ATEXIT_HACK
。glut.h
用于VC++ 2003、VC++ 2005和VC++ 2008。--- c:\naterobbins\glut.h 2000-12-13 00:22:52.000000000 +0900
+++ c:\updated\glut.h 2006-05-23 11:06:10.000000000 +0900
@@ -143,7 +143,12 @@
#if defined(_WIN32)
# ifndef GLUT_BUILDING_LIB
-extern _CRTIMP void __cdecl exit(int);
+/* extern _CRTIMP void __cdecl exit(int); /* Changed for .NET */
+# if _MSC_VER >= 1200
+extern _CRTIMP __declspec(noreturn) void __cdecl exit(int);
+# else
+extern _CRTIMP void __cdecl exit(int);
+# endif
# endif
#else
/* non-Win32 case. */