Click here to Skip to main content
15,881,852 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
error C2039: 'exit' : is not a member of '`global namespace''
error C2873: 'exit' : symbol cannot be used in a using-declaration
I'm using glut.h and when i trace definition of exit its showing me to the one in glut.h,what is the solution ?i tried placing stdlib.h above glut.h dint workout!!
Posted
Comments
Sergey Alexandrovich Kryukov 3-Aug-12 14:35pm    
Makes little to know sense without your code sample.
--SA

That's just a typical microsoft products bug.
I think the problem is in stdlib.h file
One way fix is then presumably to do
C++
#include <stdlib.h>

before anything else, and another and better fix to install the latest service pack.
Btw., the program technically needs to include <ostream>.

P/S:
Please look following article:
http://support.microsoft.com/kb/243444[^]
 
Share this answer
 
I have got this on another Forum you can try this

I have researched this issue on the web and it seems like it is something that has been an issue for a lot of people. The solution to this is as simple as removing a comment.
 


I looked through the stdlib.h file, and found the the following line was commended out:
 
_CRTIMP __declspec(noreturn) void __cdecl exit(__in int _Code);
 
I took out the comment and recompiled it ... and now it works.
 
I believe in some builds the stdlib.h file will automatically be compiled with that portion of the code commented out. simple uncomment and your code will work.


Here is the link[^]
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900