编译错误:named type definition in parentheses解决方案
来源:互联网 发布:python buffer object 编辑:程序博客网 时间:2024/06/06 12:29
今天用VC6编译7Z的SDK,报错一大堆:
Compiling...7zFile.cF:\VC98\INCLUDE\rpcasync.h(45) : error C2220: warning treated as error - no object file generatedF:\VC98\INCLUDE\rpcasync.h(45) : warning C4115: '_RPC_ASYNC_STATE' : named type definition in parentheses7zStream.cAlloc.cF:\VC98\INCLUDE\rpcasync.h(45) : error C2220: warning treated as error - no object file generatedF:\VC98\INCLUDE\rpcasync.h(45) : warning C4115: '_RPC_ASYNC_STATE' : named type definition in parenthesesLzFind.cLzFindMt.cF:\VC98\INCLUDE\rpcasync.h(45) : error C2220: warning treated as error - no object file generatedF:\VC98\INCLUDE\rpcasync.h(45) : warning C4115: '_RPC_ASYNC_STATE' : named type definition in parenthesesLzmaDec.cLzmaEnc.cF:\VC98\INCLUDE\rpcasync.h(45) : error C2220: warning treated as error - no object file generatedF:\VC98\INCLUDE\rpcasync.h(45) : warning C4115: '_RPC_ASYNC_STATE' : named type definition in parenthesesLzmaUtil.cF:\VC98\INCLUDE\rpcasync.h(45) : error C2220: warning treated as error - no object file generatedF:\VC98\INCLUDE\rpcasync.h(45) : warning C4115: '_RPC_ASYNC_STATE' : named type definition in parenthesesThreads.cF:\VC98\INCLUDE\rpcasync.h(45) : error C2220: warning treated as error - no object file generatedF:\VC98\INCLUDE\rpcasync.h(45) : warning C4115: '_RPC_ASYNC_STATE' : named type definition in parenthesesGenerating Code...Error executing cl.exe.
原因是_RPC_ASYNC_STATE结构体的定义在引用了它的后面,定位到_RPC_ASYNC_STATE定义部分VC98\Include\RPCASYNC.H,查看定义源码如下:
typedefenum _RPC_ASYNC_EVENT { RpcCallComplete, RpcSendComplete, RpcReceiveComplete } RPC_ASYNC_EVENT;typedef void RPC_ENTRYRPCNOTIFICATION_ROUTINE ( struct _RPC_ASYNC_STATE *pAsync,<span style="white-space:pre"></span>//这里使用了这个结构体,但是其定义在后面 void *Context, RPC_ASYNC_EVENT Event);typedef RPCNOTIFICATION_ROUTINE *PFN_RPCNOTIFICATION_ROUTINE; typedef struct _RPC_ASYNC_STATE { unsigned int Size; // size of this structure unsigned long Signature; long Lock; unsigned long Flags; void *StubInfo; void *UserInfo; void *RuntimeInfo; RPC_ASYNC_EVENT Event; RPC_NOTIFICATION_TYPES NotificationType; union { // // Notification by APC // struct { PFN_RPCNOTIFICATION_ROUTINE NotificationRoutine; HANDLE hThread; } APC; // // Notification by IO completion port // struct { HANDLE hIOPort; DWORD dwNumberOfBytesTransferred; DWORD dwCompletionKey; LPOVERLAPPED lpOverlapped; } IOC; // // Notification by window message // struct { HWND hWnd; UINT Msg; } HWND; // // Notification by event // HANDLE hEvent; // // Notification by callback function // // This option is available only to OLE // PFN_RPCNOTIFICATION_ROUTINE NotificationRoutine; } u; long Reserved[4]; } RPC_ASYNC_STATE, *PRPC_ASYNC_STATE;
解决方案:
加上前置声明:struct _RPC_ASYNC_STATE。
0 0
- 编译错误:named type definition in parentheses解决方案
- C++编译错误no type named ‘iterator_category’ in ‘class Point’,distance重名
- Include a structure in TYPE definition
- error:no type named iterator_category in struct
- no type named `iterator_category' in `struct Pointt'
- no type named 'vector' in namespace std
- error:no type named iterator_category in struct
- C++ 解决 multiple definition of & previous definition here编译错误
- gcc交叉编译错误: multiple definition of
- QT 编译错误 multiple definition of
- 编译报multiple definition of******错误
- C编译错误--multiple definition of 'XXX'
- 继承QGraphicsItem 编译错误:error: no member named 'staticMetaObject' in 'QGraphicsItem'; did you mean sim
- error: no type named 'u16string' in namespace 'std'
- error: no type named 'u16string' in namespace 'std'
- code signing is required for product type 'Application' in SDK 'iOS 7.0' 错误分析以及解决方案
- Android Studio出现 No service of type Factory available in ProjectScopeServices.的错误解决方案
- boost库thread.hpp编译警告(type attributes are honored only at type definition)已修复
- Unity中自动寻路的几种方法(三)
- [GDI+]DrawRectangle和FillRectangle,细节决定成败
- Excel用vba自动生成word
- Linux下安装JDK
- iOS第三方库-CocoaLumberjack-DDLog
- 编译错误:named type definition in parentheses解决方案
- 关于localStorage和sessionStorage的用法
- 自定义bash提示符 -- Bash prompt basics
- phoneGap2.9.0环境搭建
- c语言 的 内存格局分析
- Google Play In-app Billing 踩过的那些坑
- Linux下安装SVN
- C++语言中的编译预处理
- 怎么投资私募宝产品