C*e
2 楼
今天遇到一个神奇的错误
有一个别人写好的类,我试图在里面加两个short int类型的public成员变量
结果是这样的,如果我把这两个成员变量加在public:和构造函数中间,就会产生
segmentation fault;如果放在所有成员变量和成员函数的最后,就没有错误
有人知道这是为什么吗?
有一个别人写好的类,我试图在里面加两个short int类型的public成员变量
结果是这样的,如果我把这两个成员变量加在public:和构造函数中间,就会产生
segmentation fault;如果放在所有成员变量和成员函数的最后,就没有错误
有人知道这是为什么吗?
d*a
7 楼
clean build.
A*l
10 楼
As some people suggested, first try clean full build. Every binary using
that class needs to be rebuilt.
If it still has segmentation fault, hook up a debugger to the process and
let it run. When it crashes, you will see the call stack in the debugger,
that's the best way to solve such problems. There are so many possible
causes here.
One possibity is: Say this class is A, and a A* is cast to B*, because
originally A and B has the same memory layout up to certain point. And the
code is trying to
【在 C******e 的大作中提到】![](/moin_static193/solenoid/img/up.png)
: 今天遇到一个神奇的错误
: 有一个别人写好的类,我试图在里面加两个short int类型的public成员变量
: 结果是这样的,如果我把这两个成员变量加在public:和构造函数中间,就会产生
: segmentation fault;如果放在所有成员变量和成员函数的最后,就没有错误
: 有人知道这是为什么吗?
that class needs to be rebuilt.
If it still has segmentation fault, hook up a debugger to the process and
let it run. When it crashes, you will see the call stack in the debugger,
that's the best way to solve such problems. There are so many possible
causes here.
One possibity is: Say this class is A, and a A* is cast to B*, because
originally A and B has the same memory layout up to certain point. And the
code is trying to
【在 C******e 的大作中提到】
![](/moin_static193/solenoid/img/up.png)
: 今天遇到一个神奇的错误
: 有一个别人写好的类,我试图在里面加两个short int类型的public成员变量
: 结果是这样的,如果我把这两个成员变量加在public:和构造函数中间,就会产生
: segmentation fault;如果放在所有成员变量和成员函数的最后,就没有错误
: 有人知道这是为什么吗?
相关阅读
求教前端大神 Jquerymongo的sharding有人说不好 是什么原茵?Martian里似乎出现了lispBe $#%!ing explicit谁知道这个嵌套的Python if 是啥意思?请推荐C++开发环境我看到IT泡沫又要来了,真是特别的开心 (转载)Have a try on Vert.x-shellpixie - Clojure寄生在C环境haskell 真是逆天, 各种特殊符号都有特殊用途Graphlab的platform 在machine learning里用的多吗像ionic这种怎么处理image loading?C++ 有没有像go routine/channel 一样的库/框架?light table 玩clj真是神奇什么样的公司喜欢尝试新技术我是不是太mean了?yeoman和meteor的区别是什么NFLX架构不是已经很稳定了 怎么还那么花钱programming这里有没有谁读online cs master 的,能学到东西吗?angular实际项目有啥可操性?