20 7月 2010

[VS2005] error C3861: 'exit': identifier not found

when I try to use some example codes of OpenGL, I'll sometimes get the compile error
"error C3861: 'exit': identifier not found" from the keyboard subroutine:


  • void keyboard(unsigned char key, int x, int y){
  • switch(key){
  • case 27:
  • exit(0);
  • break;
  • }
  • }

Finally, I found the solution that is to add the include information on the top of the cpp file.
#include < stdlib.h >

The original discussion thread is from Windows Forums, and solution is provided by Brian Kramer.

沒有留言:

張貼留言