错误C2039:'退出':不是'`全局名称空间'的成员 [英] error C2039: 'exit' : is not a member of '`global namespace''

查看:928
本文介绍了错误C2039:'退出':不是'`全局名称空间'的成员的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

错误C2039:``退出'':不是```全局名称空间''的成员''''
错误C2873:退出":符号不能在using-declaration中使用
我正在使用glut.h,当我跟踪exit的定义时,将其显示为glut.h中的那个,那是什么解决方案?我尝试将stdlib.h放在glut.h dint锻炼之上! h2_lin>解决方案

那只是典型的Microsoft产品错误.
我认为问题出在stdlib.h文件中
然后大概是一种解决方法

 #include   ><   stdlib.h  >   


首先,另一个更好的修复程序是安装最新的Service Pack.
顺便说一句,该程序在技术上需要包含< ostream>.

P/S:
请查看以下文章:
http://support.microsoft.com/kb/243444 [我已经在网络上研究了这个问题,似乎这已经成为很多人的问题.解决此问题的方法就像删除评论一样简单. 我查看了stdlib.h文件,发现以下几行值得推荐: _CRTIMP __declspec(noreturn)void __cdecl exit(__ in in _Code); 我拿出注释并重新编译了它……现在可以正常工作了. 我相信在某些构建中,stdlib.h文件将自动被注释掉的那部分代码编译.简单的注释,您的代码就可以使用.



此处是链接 [ ^ ]


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!!

解决方案

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


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


这篇关于错误C2039:'退出':不是'`全局名称空间'的成员的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆