Linux | c&cpp | Email | github | QQ群:425043908 关注本站

itarticle.cc

您现在的位置是:网站首页 -> Windows 文章内容

解决vs不识别bool类型的问题-itarticl.cc-IT技术类文章记录&分享

发布时间: 8年前Windows 117人已围观返回

Visual Studio 2012 or newer

C:\Users\%USERNAME%\AppData\Local\Microsoft\VisualStudio\<IDE version>\Extensions\<hashed name>\Misc\StdAfxVa.h

C:\Users\%USERNAME%\AppData\Local\Microsoft\VisualStudio\<IDE version>\Extensions\<hashed name>\Misc\StdAfx.h


Visual Studio 2010

C:\Users\%USERNAME%\AppData\Local\Microsoft\VisualStudio\10.0\Extensions\Whole Tomato Software\Visual Assist X\<version number>\Misc\StdAfxVa.h

or

C:\Users\%USERNAME%\AppData\Local\Microsoft\VisualStudio\10.0\Extensions\<hashed name>\Misc\StdAfxVa.h


Visual Studio 2010 using Windows XP

Copy:

C:\Documents and Settings\%USERNAME%\Local Settings\Application Data\Microsoft\VisualStudio\10.0\Extensions\Whole Tomato Software\Visual Assist X\<version number>\Misc\StdAfxVa.h

or

C:\Users\%USERNAME%\AppData\Local\Microsoft\VisualStudio\10.0\Extensions\<hashed name>\Misc\StdAfxVa.h


Visual Studio 2008 or older

Copy:

C:\Program Files\Visual Assist X\Misc\StdAfxVa.h


Visual Studio 2008 or older, using Windows XP

Copy:

C:\Program Files\Visual Assist X\Misc\StdAfxVa.h


打开以上文件,添加如下代码

#define bool bool

或者

#define bool BOOL (测试下来,这个比较有效一点,StdAfxVa.h和StdAfx.h两个文件都加一下)


#define bool BOOL

#define BOOL bool

这个方法比较有效一点


添加后需要选择VASSISTX->Visual Assist Options -> 打开对话框 ->Performance ->Rebuild 然后重启VS 重新构建VA提示


Class members of type bool are not recognised

In rare cases class members of type bool will not be recognised as members, they won't be colored as variables, and they won't be suggested in listboxes. This can be caused by using a C library that defines its own bool type, for compilers that don't already support this type. If this happens, the solution is to add the line:

#define bool bool

to the "va_stdafx.h" file, which is used to help our parser understand complex code. This will tell VA to use the default bool type, and not the library definition.

If this does not work, you might need to use the line:

#define bool BOOL




发布时间: 8年前Windows117人已围观返回回到顶端

很赞哦! (1)

文章评论

  • 请先说点什么
    热门评论
    116人参与,0条评论

站点信息

  • 建站时间:2016-04-01
  • 文章统计:728条
  • 文章评论:82条
  • QQ群二维码:扫描二维码,互相交流