causes segmentation fault (mathgl 1.11 and mathgl 2.2). Using data creation in c++ gives
no error. Linux Mint 15, gcc 4.7, 64-bit. Am I doing something wrong in data initialization in c ? Does anyone uses mathgl from c ?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The following example code:
include<mgl2 mgl_cf.h="">
int main(int argc,char **argv)
{
HMDT y;
mgl_data_create(y,50,1,1); //segmentation fault occurs
return EXIT_SUCCESS;
}
causes segmentation fault (mathgl 1.11 and mathgl 2.2). Using data creation in c++ gives
no error. Linux Mint 15, gcc 4.7, 64-bit. Am I doing something wrong in data initialization in c ? Does anyone uses mathgl from c ?
Yes, it should. You try to change the variable ("y") which is not yet allocated. The correct calls should be
or