c++ Visual Studio, 'vc_attributes::YesNoMaybe' : 'enum' 类型重定义错误
c++ Visual Studio, 'vc_attributes::YesNoMaybe' : 'enum' type redefinition error
我正试图使用以下c++代码来获取进程的内存空间
#include "stdafx.h"
#include <windows.h>
#include <stdio.h>
#include <psapi.h>
void PrintMemoryInfo( DWORD processID )
{
HANDLE hProcess;
PROCESS_MEMORY_COUNTERS pmc;
// Print the process identifier.
printf( "nProcess ID: %un", processID );
// Print information about the memory usage of the process.
hProcess = OpenProcess( PROCESS_QUERY_INFORMATION |
PROCESS_VM_READ,
FALSE,
processID );
if (NULL == hProcess)
return;
if ( GetProcessMemoryInfo( hProcess, &pmc, sizeof(pmc)) )
{
printf( "tPageFaultCount: 0x%08Xn", pmc.PageFaultCount );
printf( "tYour app's PEAK MEMORY CONSUMPTION: 0x%08Xn",
pmc.PeakWorkingSetSize );
printf( "tYour app's CURRENT MEMORY CONSUMPTION: 0x%08Xn", pmc.WorkingSetSize );
printf( "tQuotaPeakPagedPoolUsage: 0x%08Xn",
pmc.QuotaPeakPagedPoolUsage );
printf( "tQuotaPagedPoolUsage: 0x%08Xn",
pmc.QuotaPagedPoolUsage );
printf( "tQuotaPeakNonPagedPoolUsage: 0x%08Xn",
pmc.QuotaPeakNonPagedPoolUsage );
printf( "tQuotaNonPagedPoolUsage: 0x%08Xn",
pmc.QuotaNonPagedPoolUsage );
printf( "tPagefileUsage: 0x%08Xn", pmc.PagefileUsage );
printf( "tPeakPagefileUsage: 0x%08Xn",
pmc.PeakPagefileUsage );
}
CloseHandle( hProcess );
}
int main( )
{
PrintMemoryInfo( GetCurrentProcessId() );
return 0;
}
但出现了类似的错误
Error 2 error C2011: 'vc_attributes::YesNoMaybe' : 'enum' type redefinition
Error 3 error C2011: 'vc_attributes::AccessType' : 'enum' type redefinition
Error 4 error C2011: 'vc_attributes::Pre' : 'struct' type redefinition
Error 5 error C3094: 'repeatable': anonymous usage not allowed
...
如何解决这个问题,我使用visualstudio2008
尝试清理和重建整个解决方案。有一些报告也有类似的错误,比如这里,明显的解决方案是重建。
相关文章:
- enum是C++中的宏变量还是整数变量
- 是否可以从int转换为enum类类型
- 在一个模板函数中,若输入的类型是enum类,我该如何使用std::underlying_type
- 在C++中,将int值赋给enum,反之亦然
- 两个 COM 组件中 ENUM 的重复条目
- 类继承,ENUM 与 AST 类实现的问题
- C++关于ENUM的问题。我得到的响应比枚举列表大
- sizeof(enum) 可以不同于 sizeof(std::underlying_type<Enum>::
- 如何理解c++中在命名空间内部定义的枚举类型enum
- 如何将set和enum一起使用
- 如何限制从int到enum类的转换
- 编译为 cuda 内核调用提供了"expression must have integral or unscoped enum type"
- Access C++ Enum from Swift
- 密钥错误: "Couldn't find enum caffe.EmitConstraint.EmitType"
- 叮当警告"-Wsigned-enum-bitfield"的含义
- 使用 enum 参数将 C++ 对象信号连接到 QML 信号处理程序
- 在类中使用"enum"时出错
- 有什么方法可以从C 中的Enum类获取随机
- 使用ENUM输入和退出菜单,然后切换SFML
- c++ Visual Studio, 'vc_attributes::YesNoMaybe' : 'enum' 类型重定义错误