本文介绍了间接水平不同于......的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 嗨 我有一个小问题..任何人都可以搞清楚吗? 我在M ++中使用MFC在VS.NET中工作。我有一个基于CWinApp的类 ,名为CTestHarnessApp。每当我编译这个时,我就会不断地从''错误中获得''间接级别'的错误: CTestHarnessApp theApp; // CTestHarnessApp * pTheApp =& theApp; CTestHarnessApp * pTheApp; (缺少存储类或类型说明符) (''int''与''CTestHarnessApp *''的间接级别不同) (''初始化'':无法从''CTestHarnessApp * __ w64''转换为 ''int''此转换需要reinterpret_cast,C风格的演员或 函数式演员表) 但是当我编译它时一切都还可以: CTestHarnessApp theApp; CTestHarnessApp * pTheApp =& theApp; // CTestHarnessApp * pTheApp; // pTheApp =& theApp; 我不明白!!! BOR 解决方案 Methinks还有更多内容,而不是你所说的。如果我错了(并且 这是不闻所未闻的),那么你正在使用的编译器中有一些非常糟糕的东西。 V 不,应该没有必要。 编译器可能存在问题,或者您对平台特定编程的某些方面有所了解。错误消息提到 ''__ w64''的事情。如果你正在构建一个64位目标,你应该考虑以某种特定于平台的方式声明你的指针 (我在这里猜测): CTestHarnessApp * __w64 pTheApp; 请参阅编译器文档,了解对于 指针类型的影响64位模式。我记得有多少痛苦''附近'和''远'' 指针给了MS Windows 3的程序员。*。 V HiI''ve a small problem .. can anyone figure it out?I am working in VS.NET in C++ with MFC. I have a CWinApp-based classcalled CTestHarnessApp. I keep getting the ''differs in levels ofindirection from'' error whenever I compile this:CTestHarnessApp theApp;//CTestHarnessApp* pTheApp = &theApp;CTestHarnessApp* pTheApp;pTheApp = &theApp;(missing storage-class or type specifiers)(''int'' differs in levels of indirection from ''CTestHarnessApp *'')(''initializing'' : cannot convert from ''CTestHarnessApp *__w64 '' to''int'' This conversion requires a reinterpret_cast, a C-style cast orfunction-style cast)But everything is okay when I compile this:CTestHarnessApp theApp;CTestHarnessApp* pTheApp = &theApp;//CTestHarnessApp* pTheApp;//pTheApp = &theApp;Me no understand!!!BOR 解决方案Methinks there is more to it than you''re telling. If I am wrong (andthat is not unheard of), then there is something very screwed up withthe compiler you''re using.VNo, there should be no need for that.There can be a problem with the compiler or with your understanding ofsome aspects of platform-specific programming. The error message mentionsthe ''__w64'' thing. If you''re building a 64-bit target you shouldprobably consider declaring your pointer in some platform-specific way(and I am guessing here):CTestHarnessApp * __w64 pTheApp;Consult with your compiler documentation on what the implications are forpointer types in a 64-bit mode. I remember how much pain ''near'' and ''far''pointers gave the programmers of MS Windows 3.*.V 这篇关于间接水平不同于......的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
07-02 14:03