Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C++ OpenGL
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 3-Aug-12 9:14am
Comments
Sergey Alexandrovich Kryukov at 3-Aug-12 14:35pm
   
Makes little to know sense without your code sample.
--SA
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

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
#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[^]
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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[^]
  Permalink  
v2

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 8,478
1 OriginalGriff 6,516
2 Peter Leow 3,567
3 Zoltán Zörgő 3,386
4 Richard MacCutchan 2,397


Advertise | Privacy | Mobile
Web04 | 2.8.150123.1 | Last Updated 4 Aug 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100