using namespace std;typedef struct{tU16 u16AppID;tU16 u16RegisterID;tU16 u16CmdCounter;tU16 u16FunctionID;tU16 u16SourceSubID;tU32 u32InternalData;} trMessageDataForMethodResult;class ExecuteTest{auto_ptr< trMessageDataForMethodResult >_MessageDataForMethodResultExecuteTest;};I am using RVCT compiler( ARM )推荐答案我忘了粘贴问题, 执行以下代码时(我删除的代码我不是 禁止发布)。我收到错误,因为合格的名字不是 允许在宣布auto_ptr对象的行。可以告诉我一些 告诉我是什么问题 5月15日下午2:43,hyderabadblues< sirishku ... @ gmail.comwrote:I forgot to paste the problem,While executing following code( I have removed code that Im notsuppossed to post).I am getting the error as qualified name is notallowed at the line where an object of auto_ptr is declared.Can sometell me what is the problemOn May 15, 2:43 pm, hyderabadblues <[email protected]: using namespace std; typedef struct { t1616 u16AppID; tU16 u16RegisterID; t1616 u16CmdCounter; t1616 u16FunctionID; tU16 u16SourceSubID; tU32 u32InternalData; } trMessageD ataForMethodResult; class ExecuteTest { auto_ptr< trMessageDataForMethodResult> _MessageDataForMethodResultExecuteTest; }; 我正在使用RVCT编译器(ARM)using namespace std;typedef struct{ tU16 u16AppID; tU16 u16RegisterID; tU16 u16CmdCounter; tU16 u16FunctionID; tU16 u16SourceSubID; tU32 u32InternalData;} trMessageDataForMethodResult;class ExecuteTest{ auto_ptr< trMessageDataForMethodResult >_MessageDataForMethodResultExecuteTest;};I am using RVCT compiler( ARM ) On 15 Maj,14:43,hyderabadblues< sirishku ... @ gmail.comwrote:On 15 Maj, 14:43, hyderabadblues <[email protected]: 使用命名空间std; typedef struct { t1616 u16AppID; tU16 u16RegisterID; t1616 u16CmdCounter; tU16 u16FunctionID; tU16 u16SourceSubID; tU32 u32InternalData; } trMessageDataForMethodResult; class ExecuteTest { auto_ptr< trMessageDataForMethodResult> _MessageDataForMethodResultExecuteTest; }; 我正在使用RVCT编译器(ARM)using namespace std;typedef struct{ tU16 u16AppID; tU16 u16RegisterID; tU16 u16CmdCounter; tU16 u16FunctionID; tU16 u16SourceSubID; tU32 u32InternalData;} trMessageDataForMethodResult;class ExecuteTest{ auto_ptr< trMessageDataForMethodResult >_MessageDataForMethodResultExecuteTest;};I am using RVCT compiler( ARM ) 我不知道这是不是问题(因为我稍微修改了 版本在VC ++ 8上编译得很好)但是在C ++中你通常会这样宣布一个 结构: struct Name { int members; }; 没有typedef。 - Erik Wikstr ?mI don''t know if this is the problem (since my slightly modifiedversion compiles just fine on VC++8) but in C++ you normally declare astruct like this:struct Name{int members;};with no typedefs.--Erik Wikstr?m 5月15日下午3:03,Erik Wikstr?m< eri ... @ student.chalmers.sewrote:On May 15, 3:03 pm, Erik Wikstr?m <[email protected]: 在15 Maj,14:43,hyderabadblues< sirishku ... @ gmail.comwrote:On 15 Maj, 14:43, hyderabadblues <[email protected]: using命名空间标准; using namespace std; typedef struct { t1616 u16AppID; tU16 u16RegisterID; t1616 u16CmdCounter; tU16 u16FunctionID; tU16 u16SourceSubID; tU32 u32InternalData; typedef struct { tU16 u16AppID; tU16 u16RegisterID; tU16 u16CmdCounter; tU16 u16FunctionID; tU16 u16SourceSubID; tU32 u32InternalData; } trMessageDataForMethodResult; } trMessageDataForMethodResult; class ExecuteTest { auto_ptr< trMessageDataForMethodResult> _MessageDataForMethodResultExecuteTest; class ExecuteTest { auto_ptr< trMessageDataForMethodResult > _MessageDataForMethodResultExecuteTest; }; }; 我正在使用RVCT编译器(ARM) I am using RVCT compiler( ARM ) 我不知道如果这是问题(因为我稍微修改了 版本在VC ++ 8上编译得很好)但是在C ++中你通常会声明一个 结构,如下所示: struct name { int member; }; 。 - Erik Wikstr?mI don''t know if this is the problem (since my slightly modifiedversion compiles just fine on VC++8) but in C++ you normally declare astruct like this:struct Name{ int members;};with no typedefs.--Erik Wikstr?m 我也试过改变结构声明。但它没有 工作I have also tried changing the structure declatration. but it didntworked 这篇关于不允许使用限定名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 06-05 00:50