-1

I try to use mglData just as the simplest way:

#include <mgl2/qt.h>

int main()
{
   mglData y;
   return 0;
}

and compile it with:

g++ *.cpp -lmgl-qt -lmgl

Then I get a executable file a.out. But when I try to execute by

./a.out

Error occured:

Segmentation fault (core dumped)

How do I solve this problem?

TimeCoder
  • 15
  • 2

1 Answers1

1

I guess it should work. Did you compile the MathGL yourself? Maybe you got something wrong in the process.

  • No, I didn't install from compiling source code. I use "sudo apt-get install matgl libmgl-dev". But libmgl-dev cannot install. So I download a deb package. But when it is almost successful, an error occured. But many other function and class can use normally(except mglData). I try to reinstall, the same error. So how do I solve it now? – TimeCoder Sep 03 '17 at 17:20
  • So, that is the root cause of your problem. You need to be more specific about what not worked during the library installation. This deb package is probably not suited for your system. I would recommend closing this question and opening a new one with all the error information you got during the libmgl installation. – Pedro Linhares Sep 03 '17 at 17:57