Question

I have installed the MathGL library in my win7 machine using the windows binary as found in sourceforge. I have followed the instruction and I have included the mathgl bin;include and lib files into the corresponded mingw folders. But when I try to run the following test example:

#include <mgl2/mgl.h>
int main()
{
  mglGraph gr;
  gr.FPlot("sin(pi*x)");
  gr.WriteFrame("test.png");
}

Its does not compile and gives the following errors:

build log:

           from /mingw/lib/gcc/mingw32/../../../include/mgl2/mgl.h:24,
                 from C:\Users\Roadmaster\Desktop\Plot_Xpto\xpto\main.cpp:1:
/mingw/lib/gcc/mingw32/../../../include/mgl2/canvas.h:409: error: expected ';' before '*' token
Process terminated with status 1 (0 minutes, 3 seconds)
2 errors, 0 warnings

Header file missing:

#include <gif_lib.h>

I have noticed that the precompiled windows folder don't have that specific header "gif_lib.h".

My questions are the following:

Did I miss something during the installation?? If I didn't where I can find that specific header (I have googled and nothing :( )?

I have installed the the library as per the following instructions:

"1.3 Installation

MathGL can be installed in 4 different ways.

Compile from sources. The cmake build system is useded in the library. To run it, one should execute commands: cmake . twice, after it make and make install with root/sudo rights. Sometimes after installation you may need to update the library list – just execute ldconfig with root/sudo rights. There are several additional options which are switched off by default. They are: enable-fltk, enable-glut, enable-qt for ebabling FLTK, GLUT and/or Qt windows; enable-jpeg, enable-gif, enable-hdf5 and so on for enabling corresponding file formats; enable-all for enabling all additional features. For using double as base internal data type use option enable-double. For enabling language interfaces use enable-python, enable-octave or enable-all-swig for all languages. You can use WYSIWYG tool (cmake-gui) to view all of them, or type cmake -D enable-all=on -D enable-all-widgets=on -D enable-all-swig=on . in command line for enabling all features.

Use a precompiled binary. There are binaries for MinGW (platform Win32). For a precompiled variant one needs only to unpack the archive to the location of the compiler (i.e. mathgl/lib in mingw/lib, mathgl/include in mingw/include and so on) or in arbitrary other folder and setup paths in compiler. By default, precompiled versions include the support of GSL (www.gsl.org) and PNG. So, one needs to have these libraries installed on system (it can be found, for example, at http://gnuwin32.sourceforge.net/packages.html). Install precompiled versions from standard packages (RPM, deb, DevPak and so on). Note, you can download the latest sources (which can be not stable) from sourceforge.net SVN by command

svn checkout http://svn.code.sf.net/p/mathgl/code/mathgl-2x mathgl-code""

No correct solution

OTHER TIPS

For older MathGL versions, it is supposed that you have installed all additional libraries (i.e. giflib -- which header file is absent).

For newer MathGL versions all this external dependencies are "hidden" and not required.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top