问题描述
我在可可应用程序中使用c ++库。
我从macos应用程序c ++代码调用c ++库代码。
我遇到库中的Client类返回的问题
I use c++ library in cocoa application.And i call c++ library code from macos application c++ code.I run into problem that Client class in library returns
sizeof Client 976
但在Mac OS应用程式中有
but in Mac OS application i have
sizeof Client 944
客户类
任何人都可以解释为什么?
Can any one explain why is that?
推荐答案
父类,并发现父类(Speaker)的一个成员(CriticalSection)导致此大小差异。
After comparetion of Client classes i went to it parent class and found that one member (CriticalSection) of parent class (Speaker) cause this difference of size.
在此文件的标题中,我发现由于未定义宏Mac OS应用程序使用此类(CriticalSection)的不同定义,这会导致大小的差异。
In header of this file i found that because of not defined macros Mac OS application use different definition of this class(CriticalSection) which cause difference of size.
这篇关于с++ sizeof类型在库和调用代码不同的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!