首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >用imapi2 c++编译mingw64 c++“不带类型的'__RPC__range‘声明”时的impi2.h错误

用imapi2 c++编译mingw64 c++“不带类型的'__RPC__range‘声明”时的impi2.h错误
EN

Stack Overflow用户
提问于 2014-03-14 17:50:07
回答 1查看 407关注 0票数 1

我试图使用imapi2来使用c++程序编写cd,该程序是在windows上使用mingw进行编译的。我正在看一个Visual c++示例。我从MicrosoftSDK7.1中将imapi2.h复制到我的项目中,但是当我在头文件中包含#include " imapi2.h“并试图编译时,我从imapi2.h文件中得到了一堆错误。我认为这是因为头文件是为Visual设置的。错误很严重。是否可以使用混合编译器来使用imapi2?谢谢

代码语言:javascript
复制
g++ -O0 -g3 -Wall -c -fmessage-length=0 -o cdtest.o "..\\cdtest.cpp"

In file included from ..\cdtest.h:7:0,

                 from ..\cdtest.cpp:2:

..\imapi2.h:17:0: warning: ignoring #pragma warning  [-Wunknown-pragmas]

#pragma warning( disable: 4049 )  /* more than 64k source lines */

^

In file included from ..\cdtest.h:7:0,

                 from ..\cdtest.cpp:2:

..\imapi2.h:1148:35: error: ISO C++ forbids declaration of '__RPC__range' with no type [-fpermissive]

typedef /* [range] */ __RPC__range(0,0xffff) ULONG ULONG_IMAPI2_DVD_STRUCTURE;

                                   ^

..\imapi2.h:1148:35: error: typedef '__RPC__range' is initialized (use decltype instead)

..\imapi2.h:1150:35: error: ISO C++ forbids declaration of '__RPC__range' with no type [-fpermissive]

typedef /* [range] */ __RPC__range(0,0xfffffff) ULONG ULONG_IMAPI2_ADAPTER_DESCRIPTOR;

                                   ^

..\imapi2.h:1150:35: error: typedef '__RPC__range' is initialized (use decltype instead)

..\imapi2.h:1152:35: error: ISO C++ forbids declaration of '__RPC__range' with no type [-fpermissive]

typedef /* [range] */ __RPC__range(0,0xfffffff) ULONG ULONG_IMAPI2_DEVICE_DESCRIPTOR;

                                   ^

..\imapi2.h:1152:35: error: typedef '__RPC__range' is initialized (use decltype instead)

..\imapi2.h:1154:35: error: ISO C++ forbids declaration of '__RPC__range' with no type [-fpermissive]

typedef /* [range] */ __RPC__range(0,0x10002) ULONG ULONG_IMAPI2_DISC_INFORMATION;

                                   ^

..\imapi2.h:1154:35: error: typedef '__RPC__range' is initialized (use decltype instead)

..\imapi2.h:1156:35: error: ISO C++ forbids declaration of '__RPC__range' with no type [-fpermissive]

typedef /* [range] */ __RPC__range(0,0x10002) ULONG ULONG_IMAPI2_TRACK_INFORMATION;

                                   ^

..\imapi2.h:1156:35: error: typedef '__RPC__range' is initialized (use decltype instead)

..\imapi2.h:1158:35: error: ISO C++ forbids declaration of '__RPC__range' with no type [-fpermissive]

typedef /* [range] */ __RPC__range(0,0x100) ULONG ULONG_IMAPI2_FEATURE_PAGE;

                                   ^

..\imapi2.h:1158:35: error: typedef '__RPC__range' is initialized (use decltype instead)

..\imapi2.h:1160:35: error: ISO C++ forbids declaration of '__RPC__range' with no type [-fpermissive]

typedef /* [range] */ __RPC__range(0,0x101) ULONG ULONG_IMAPI2_MODE_PAGE;

                                   ^



[. . .]



                                                                                                                                   ..\imapi2.h:1194:47: error: expected ')' before numeric constant

             /* [range][in] */ __RPC__in_range(6,16) ULONG CdbSize,

                                               ^

..\imapi2.h:1194:47: error: expected ')' before numeric constant

..\imapi2.h:1194:46: error: expected ';' at end of member declaration

             /* [range][in] */ __RPC__in_range(6,16) ULONG CdbSize,

                                              ^

..\imapi2.h:1194:47: error: expected unqualified-id before numeric constant

             /* [range][in] */ __RPC__in_range(6,16) ULONG CdbSize,

                                               ^

..\imapi2.h:1200:31: error: '__RPC__in_range' has not been declared

             /* [range][in] */ __RPC__in_range(6,16) ULONG CdbSize,



[. . .]
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2014-04-17 17:30:43

为了克服这些错误,我发现每个地方都有一个#include "imapi2.h",它需要使用一个#include rpcsal.h。作为我的系统中的另一种选择,在每个#include "imapi2.h"之前向行添加以下内容也是可行的。

#define __RC__range(min,max)

#define __RC__in_range(min,max)

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/22412297

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档