I don't understand the reason for a segmentation fault error in my program.
The code is available here
At line 29 I declare a PclImage
variable, defined with typedef like an array of struct.
The definition of PclImage
type is the following (from src/libMyKinect.h file):
typedef struct {
int valid;
float x;
float y;
float z;
unsigned char blue;
unsigned char green;
unsigned char red;
} Point3d;
typedef Point3d PclImage[480][640];
The program works well, but when I declare a second PclImage
, I get a segmentation fault as soon as I launch the program.
For example, if at line 30 of the first file I add PclImage bgPcl;
the program immediately crashes.
Can anyone help me?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…