新手刚加入C++,拿着源码环境报错,求求大家

报了一堆错误 winternl.h 这是包含文件啊系统的,怎么可能会报错啊,求求大家,这是什么错误,我装的VC6.0编译的

--------------------Configuration: Shell - Win32 Debug--------------------
Compiling...
BrowserWnd.cpp
c:\program files (x86)\microsoft visual studio\vc98\include\winternl.h(75) : error C2011: '_FILETIME' : 'struct' type redefinition
c:\program files (x86)\microsoft visual studio\vc98\include\winternl.h(1786) : error C2065: 'POWER_ACTION' : undeclared identifier
c:\program files (x86)\microsoft visual studio\vc98\include\winternl.h(1786) : error C2065: 'SYSTEM_POWER_STATE' : undeclared identifier
c:\program files (x86)\microsoft visual studio\vc98\include\winternl.h(1786) : error C2275: 'ULONG' : illegal use of this type as an expression
c:\program files (x86)\microsoft visual studio\vc98\include\windef.h(43) : see declaration of 'ULONG'
c:\program files (x86)\microsoft visual studio\vc98\include\winternl.h(1786) : error C2275: 'BOOLEAN' : illegal use of this type as an expression
c:\program files (x86)\microsoft visual studio\vc98\include\winnt.h(636) : see declaration of 'BOOLEAN'
c:\program files (x86)\microsoft visual studio\vc98\include\winternl.h(1786) : warning C4229: anachronism used : modifiers on data are ignored
c:\program files (x86)\microsoft visual studio\vc98\include\winternl.h(1786) : error C2078: too many initializers
c:\program files (x86)\microsoft visual studio\vc98\include\winternl.h(1786) : error C2275: 'BOOLEAN' : illegal use of this type as an expression
c:\program files (x86)\microsoft visual studio\vc98\include\winnt.h(636) : see declaration of 'BOOLEAN'
c:\program files (x86)\microsoft visual studio\vc98\include\winternl.h(1812) : error C2065: 'POWER_INFORMATION_LEVEL' : undeclared identifier
c:\program files (x86)\microsoft visual studio\vc98\include\winternl.h(1812) : error C2275: 'PVOID' : illegal use of this type as an expression
c:\program files (x86)\microsoft visual studio\vc98\include\winnt.h(106) : see declaration of 'PVOID'
c:\program files (x86)\microsoft visual studio\vc98\include\winternl.h(1812) : error C2275: 'ULONG' : illegal use of this type as an expression
c:\program files (x86)\microsoft visual studio\vc98\include\windef.h(43) : see declaration of 'ULONG'

该回答引用ChatGPT-3.5

您好!从您提供的编译错误来看,似乎是在包含winternl.h头文件时遇到了一些问题,其中涉及到了一些未声明的标识符和类型重定义等问题。


可能的原因有以下几种:

  1. 版本问题:您正在使用的VC6.0编译器已经相当古老了,而winternl.h文件是Windows操作系统提供的系统级头文件。您可以考虑升级到较新的编译器,比如Visual Studio 2019,并检查系统是否具有支持的版本。
  1. 文件重复包含:您的源文件中可能已经包含了winternl.h头文件,而在编译时又将该头文件包含进来,导致类型重定义等错误。您可以在源文件中检查是否重复包含了该头文件,并保留必要的头文件。
  1. 系统环境问题:由于winternl.h头文件是Windows操作系统提供的系统级头文件,因此在某些情况下,可能需要特定的环境或库文件支持。您可以检查系统环境和库文件是否正确配置,并尝试重新编译程序。

希望以上建议能对您解决问题有所帮助!