Click to See Complete Forum and Search --> : why does't exit() work in .NET


urquidio
December 9th, 2003, 05:32 PM
Hi everyone,

i've worked a lot with Visual Studio 6.0 and recently have
moved to .NET. As i'm trying to get my old projects to compile,
i get a lot of errors.

one of them, for example, seems to be related to the exit()
call:

c:\research\main.cpp(78) : error C3861: 'exit': identifier not found, even with argument-dependent lookup

etc, etc

is there something wrong with using exit() in .NET?

Thanks!

urquidio
December 9th, 2003, 05:51 PM
even if i remove the exit() call from my code, it still seems to have trouble with stdlib.h and glut.h:


c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\stdlib.h(256) : error C2381: 'exit' : redefinition; __declspec(noreturn) differs

c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\GL\glut.h(146) : see declaration of 'exit'

any ideas on how to fix this?

vicodin451
December 10th, 2003, 07:57 AM
I created a new proj in VS.NET 2003, and added:

exit( 666 );

to a button-click handler, and it built just fine.

How are you calling exit?
I'm not familiar with glut. Does it define a function called "exit"?

MooNull
December 11th, 2003, 11:32 PM
What exactly does exit do? Close the window?

vicodin451
December 12th, 2003, 07:36 AM
Originally posted by MooNull
What exactly does exit do? Close the window?
If this was in response to my post, exit terminated the application. exit does not return. It calls ExitProcess.

If this is a general question as to what exit does, it terminates the calling process (as eluded to above).