文件系统 - 内存映射文件库

时间:2012-01-17 20:52:30

标签: c winapi

我需要使用内存映射文件在c中实现一些虚拟文件系统。 在这种情况下我被包含在winbase.h中,但我从这个库中得到了很多错误,如:

Error   1   error C2061: syntax error : identifier 'PVOID'  c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h   250 1   FileIO
Error   2   error C2059: syntax error : '}' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h   251 1   FileIO
Error   3   error C2061: syntax error : identifier 'hEvent' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h   253 1   FileIO
Error   4   error C2059: syntax error : ';' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h   253 1   FileIO
Error   5   error C2059: syntax error : '}' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h   254 1   FileIO
Error   6   error C2061: syntax error : identifier 'LPOVERLAPPED'   c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h   258 1   FileIO
Error   7   error C2059: syntax error : '}' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h   261 1   FileIO
Error   8   error C2061: syntax error : identifier 'LPVOID' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h   265 1   FileIO
Error   9   error C2061: syntax error : identifier 'bInheritHandle' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h   266 1   FileIO
Error   10  error C2059: syntax error : ';' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h   266 1   FileIO
Error   11  error C2059: syntax error : '}' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h   267 1   FileIO
Error   12  error C2016: C requires that a struct or union has at least one member  c:

...

在winbase.h之前我被收录在intsafe.h中。我是否需要包含其他库才能在我的c应用程序中使用winbase.h? 感谢您的建议

1 个答案:

答案 0 :(得分:3)

包含windows.h而不是winbase.h。

winbase.h不包含PVOID之类的许多typedef。