c++ - error C2065: 'errno' : undeclared identifier in <string> in Visual Studio 2012 -


i had project running in visual studio 2010. using visual studio 2012. getting below error while building project. have looked google , so well. no got solution.

    c:\program files\microsoft visual studio 11.0\vc\include\string(557): error c2065: 'errno' : undeclared identifier 2>c:\program files\microsoft visual studio 11.0\vc\include\string(557): error c2065: 'errno' : undeclared identifier 2>c:\program files\microsoft visual studio 11.0\vc\include\string(562): error c2065: 'errno' : undeclared identifier 2>c:\program files\microsoft visual studio 11.0\vc\include\string(574): error c2065: 'errno' : undeclared identifier 2>c:\program files\microsoft visual studio 11.0\vc\include\string(579): error c2065: 'errno' : undeclared identifier 

i have tried including stdlib.h sting header file still getting same error.

any appreciated.

there several possible reasons problem. first thing should create 1 line source:

#include <string> 

and nothing else, , try compile it. if doesn't compile, there problem installation, , should reinstall it. then, sure, delete everything in source tree except actual sources, project files , solution, , rebuild. there may old files laying around somehow causing problem. doubt it, should anyway, time upgrade compiler, or install patch. (if you've got under source code control, should, simplest solution delete everything, , new, clean checkout.)

if these measures don't solve problem (and somehow, suspect won't), there's problem in code base somewhere. errno required macro standard; error message cite, macro must undefined. <string> includes (indirectly) file defines it. given this, cause can think of earlier include file has included file defines errno, , #undefed it. verify this, put #include <string> first include of source, , see if solves problem. if does, have find file #undef, , fix it.


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -