install mgl lib in ubuntu

898 views
Skip to first unread message

Frédéric Ferrieu

unread,
Aug 23, 2013, 7:10:12 AM8/23/13
to mat...@googlegroups.com
#include <mgl2/mgl.h>
#include <mgl.h>
int main()
{
  mglGraph *gr=new mglGraph;
  gr->FPlot("sin(pi*x)");
  gr->WriteFrame("test.png");

}

I get

/QWT6/6_8_2013/qwt-6.0.0-rc5/examples/curvdem 1/curvdemo1.cpp:-1: error: undefined reference to `mgl_use_graph'
error in linker

I am under UBUNTU
running Qt5 last release

It seems that a lot of users get linking errors in this environment
I did the same using NetBeans 7.4  and again with these troubles
external lib exist libmgl.a or .so

could you help?
thank you
Frederic

mathgl....@gmail.com

unread,
Aug 26, 2013, 3:03:50 AM8/26/13
to mat...@googlegroups.com
Dear Frédéric,

There are 2 points you need to check.

1. Ubuntu still provide v.1.11.* which is binary incompatible with v.2.* (in particular, there is no `mgl_use_graph'). You should decide which version you need and remove other one, or properly set linker to use only the version you want.

2. By default, recent Ubuntu install Qt5, which is rather new and isn't supported by MathGL now (in v.2.1.3). So, if you need Qt widget (or Qt window) you need to install Qt4. FLTK widget/window still work well.



2013/8/23 Frédéric Ferrieu <ffer...@gmail.com>

--
You received this message because you are subscribed to the Google Groups "MathGL" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mathgl+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



--
All the best,
Alexey Balakin

Frédéric Ferrieu

unread,
Sep 1, 2014, 4:32:28 AM9/1/14
to mat...@googlegroups.com
so do I have only to remove the v.2.3.1 version?  how to proceed with a sudo command?
which lib do I have to install through Synaptic package?
in fact its not so easy to find where these libs are always located .
Should it be running well inside windows 8.1 and netbeans 8.0?
your support is very useful
thanks again
Frederic

mathgl....@gmail.com

unread,
Sep 1, 2014, 8:00:20 AM9/1/14
to mat...@googlegroups.com
Dear Frederic,

You need to compile from sources if you want to install the latest version. The installation instructions can be found at http://mathgl.sourceforge.net/doc_en/Installation.html#Installation

Shortly there are a few steps:

1. Unpack source files

tar -zxf mathgl-2.*.tar.gz
cd mathgl-2.*

2. Make folder for binary files (this can be omitted)

mkdir build
cd build

3. Configure build system (call it at least twice)

cmake ..
# resolve errors if one present (like "sudo apt-get install libpng-dev")
cmake ..

Or you can use cmake-gui for visual way. Here you'll need a set of development packages (like, libpng-dev and so on). Just install one which produce an error -- cmake-gui is much more suitable for that (at least at first time). Also, here you can set extra optimization or extra feature flags and so on.

4. Make it. At this you may be asked by some extra libraries (which where missed by cmake -- it is issue of corresponding cmake routines :( )

make

5. Install it

sudo make install
sudo ldconfig

Here "sudo ldconfig" need to be executed at each new major version.

MathGL is ready.

For another computer (another OS, like windows, or 32bit instead of 64bit), you just need to repeat these steps again.



For more options, visit https://groups.google.com/d/optout.



--
Kind regards,
Alexey Balakin

Frédéric Ferrieu

unread,
Sep 1, 2014, 1:25:47 PM9/1/14
to mat...@googlegroups.com
ok thtas what I did  and I can do it again  but as I am choosing the new libmgl.a or libmgl.so from the directory ../../../../MATHGL/mathgl-2.3/build/src/
I do the link with some undefined references such as the error at link occurs
g++ -lmgl-wnd `wx-config --cxxflags` `wx-config --libs` -lmgl-fltk  -lmgl-qt -lmgl-glut     -c -g -I../../include -I/usr/local/include -MMD -MP -MF "build/Debug/GNU-Linux-x86/main.o.d" -o build/Debug/GNU-Linux-x86/main.o main.cpp
mkdir -p dist/Debug/GNU-Linux-x86
g++ -o dist/Debug/GNU-Linux-x86/CppMathGl02 build/Debug/GNU-Linux-x86/main.o ../../../../MATHGL/mathgl-2.3/build/src/libmgl.a `wx-config --cxxflags` `wx-config --libs` -lmgl-fltk -lmgl-qt -lmgl-wx
../../../../MATHGL/mathgl-2.3/build/src/libmgl.a(export.cpp.o): In function `mgl_show_image':
export.cpp:(.text+0x25f0): warning: the use of `tmpnam' is dangerous, better use `mkstemp'
/usr/bin/ld: ../../../../MATHGL/mathgl-2.3/build/src/libmgl.a(data_io.cpp.o): undefined reference to symbol 'gzclose'
//lib/x86_64-linux-gnu/libz.so.1: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[2]: *** [dist/Debug/GNU-Linux-x86/CppMathGl02] Error 1
make[2]: Leaving directory `/home/frederic/NetBeansProjects/C++Programs/armadillo/armadillo-3.6.1/NewFolder/CppMathGl02'
make[1]: *** [.build-conf] Error 2
make[1]: Leaving directory `/home/frederic/NetBeansProjects/C++Programs/armadillo/armadillo-3.6.1/NewFolder/CppMathGl02'
make: *** [.build-impl] Error 2

BUILD FAILED (exit value 2, total time: 1s)

is there another library I have to include in order to find mgl_show_image' and gzclose ?
at this level  do I will be able to use the mglData class without this segmentation occur error?

thank you
regards
Frederic

Frédéric Ferrieu

unread,
Sep 2, 2014, 3:47:16 AM9/2/14
to mat...@googlegroups.com
well these troubles with linking have been solved
 neverthless I still have this segment problem when running the program when setting or including the mglData a; declaration. that means that its impossible to build arrays and plot them...
what else to do for running every thing ok?
thanks again
Frederic

mathgl....@gmail.com

unread,
Sep 6, 2014, 12:51:32 AM9/6/14
to mat...@googlegroups.com
Dear Frederic,

I couldn't reproduce such error. So, I have a few questions:

1. Are you sure what you don't link/use different versions of MathGL libraries?

2. Can you get me information where segfault take place, i.e. run it in debugger (in console [dbg ./a.out]+[run]+[bt] or in IDE) and show me the point (the function,...)?

3. Can you send me exact sample code which produce the error, and detailed information about OS?

Frédéric Ferrieu

unread,
Sep 10, 2014, 6:09:21 AM9/10/14
to mat...@googlegroups.com
Tim Newton make deb package and actually I downloaded from it!!
https://sourceforge.net/projects/mglua/

this repository works perfectly well for kubuntu 14.04 what's the differences in between?

by the way I had  questions how to change window size in your sample i.e.
when one has
int main()
{
mglGraph gr;
gr.FPlot("sin(pi*x)");
gr.WriteFrame("test.png");
}
how to change the drawing size on the screen of my computer?

The other problem is as soon as you use a mglData arrays which can be filled using the Set  method
on the other way How to keep back the values inside a mglData variable in order to fill  a C++ regular array i.e. double**  or float *  ?
regards
Frederic

mathgl....@gmail.com

unread,
Sep 15, 2014, 8:13:08 AM9/15/14
to mat...@googlegroups.com
Dear Frederic,

2014-09-10 14:09 GMT+04:00 Frédéric Ferrieu <ffer...@gmail.com>:
Tim Newton make deb package and actually I downloaded from it!!
https://sourceforge.net/projects/mglua/

this repository works perfectly well for kubuntu 14.04 what's the differences in between?

I think this is older version. Lua support is included natively in MathGL since v.2.2
 

by the way I had  questions how to change window size in your sample i.e.
when one has
int main()
{
mglGraph gr;

Just call here
gr.SetSize(width, height);
 
gr.FPlot("sin(pi*x)");
gr.WriteFrame("test.png");
}
how to change the drawing size on the screen of my computer?

The other problem is as soon as you use a mglData arrays which can be filled using the Set  method
on the other way How to keep back the values inside a mglData variable in order to fill  a C++ regular array i.e. double**  or float *  ?

you can use mglData::a or mgl_data_data() function -- see http://mathgl.sourceforge.net/doc_en/Public-variables.html#Public-variables
 
--
Kind regards,
Alexey Balakin

Frédéric Ferrieu

unread,
Dec 9, 2014, 5:39:00 PM12/9/14
to mat...@googlegroups.com
hello Alexey
I am back trying to reinstall mathgl on a new re formatted pc and I forgot a lot of what I have been doing the last time and that was working fine.
Just right now I dont know or remenber how to set up with the  windows.h the fltk and the glut environment. I swa that you say
" 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-"
how do you introduce these parameter is it some thi ng like instead of setting make . twice writnig this time some cmake or make with these options ( i.e. enable xxx) or do I need to modify the Makefile ?
by the way it might be good to give directly the list of the needed to be installed library in the case of UBUNTU 14.10
 In fact Im very upset since all the programs I made do not work anymore just because I heve the mathgl not correctly installed  ( do I need to remove all the mgl lib found in the system using Synaptic?
Thanks for your help once again
regards

Frederic

On Monday, August 26, 2013 9:03:50 AM UTC+2, Alexey Balakin wrote:

mathgl....@gmail.com

unread,
Dec 11, 2014, 3:51:08 AM12/11/14
to mat...@googlegroups.com
Dear Frederic,

Just install cmake-gui (package cmake-qt-gui in Ubuntu) and run it. After setting path to MathGL folders, you'll see all possible options, which MathGL provide. See cmake-gui documentation if you need an instruction for how it can be used (like, http://www.cmake.org/cmake/help/v3.0/manual/cmake-gui.1.html or http://www.cmake.org/runningcmake/).

For more options, visit https://groups.google.com/d/optout.

Frédéric Ferrieu

unread,
Dec 11, 2014, 10:11:18 AM12/11/14
to mat...@googlegroups.com
I thank you for your advice
now another trouble occurs when I get zhe following error
CLEAN SUCCESSFUL (total time: 455ms)
/usr/bin/make -f nbproject/Makefile-Debug.mk build/Debug/GNU-Linux-x86/main.o
mkdir -p build/Debug/GNU-Linux-x86
rm -f "build/Debug/GNU-Linux-x86/main.o.d"

g++ -lmgl-wnd `wx-config --cxxflags` `wx-config --libs` -lmgl-fltk  -lmgl-qt -lmgl-glut     -c -g -I../../include -I/usr/local/include -MMD -MP -MF "build/Debug/GNU-Linux-x86/main.o.d" -o build/Debug/GNU-Linux-x86/main.o main.cpp
In file included from /usr/local/include/FL/Fl_Menu_.H:28:0,
                 from /usr/local/include/FL/Fl_Menu_Bar.H:25,
                 from /usr/include/mgl2/fltk.h:68,
                 from /usr/include/mgl2/window.h:24,
                 from main.cpp:1:
/usr/local/include/FL/Fl_Menu_Item.H: In member function ‘long int Fl_Menu_Item::argument() const’:
/usr/local/include/FL/Fl_Menu_Item.H:259:40: error: ‘fl_intptr_t’ was not declared in this scope
   long argument() const {return (long)(fl_intptr_t)user_data_;}
                                        ^
/usr/local/include/FL/Fl_Menu_Item.H:259:52: error: expected ‘;’ before ‘user_data_’
   long argument() const {return (long)(fl_intptr_t)user_data_;}
                                                    ^
make: *** [build/Debug/GNU-Linux-x86/main.o] Error 1
nbproject/Makefile-Debug.mk:66: recipe for target 'build/Debug/GNU-Linux-x86/main.o' failed

COMPILE FILE FAILED (exit value 2, total time: 2s)

when trying to compile :

#include <mgl2/window.h>
#include <mgl2/data.h>
#include <mgl2/mgl.h>
#include <mgl2/type.h>



 
void mgls_prepare2d(mglData *a, mglData *b=0, mglData *v=0)
{
register long i,j,n=50,m=40,i0;
if(a) a->Create(n,m); if(b) b->Create(n,m);
if(v) { v->Create(9); v->Fill(-1,1); }
float x,y;
for(i=0;i<n;i++) for(j=0;j<m;j++)
{
x = i/(n-1.); y = j/(m-1.); i0 = i+n*j;
if(a) a->a[i0] = 0.6*sin(2*M_PI*x)*sin(3*M_PI*y)+0.4*cos(3*M_PI*x*y);
if(b) b->a[i0] = 0.6*cos(2*M_PI*x)*cos(3*M_PI*y)+0.4*cos(3*M_PI*x*y);
}
}
void mgls_prepare2v(mglData *a, mglData *b)
{
register long i,j,n=20,m=30,i0;
if(a) a->Create(n,m); if(b) b->Create(n,m);
float x,y;
for(i=0;i<n;i++) for(j=0;j<m;j++)
{
x=i/(n-1.); y=j/(m-1.); i0 = i+n*j;
if(a) a->a[i0] = 0.6*sin(2*M_PI*x)*sin(3*M_PI*y)+0.4*cos(3*M_PI*x*y);
if(b) b->a[i0] = 0.6*cos(2*M_PI*x)*cos(3*M_PI*y)+0.4*cos(3*M_PI*x*y);
}
}
void mgls_prepare3v(mglData *ex, mglData *ey, mglData *ez)
{
register long i,j,k,n=10,i0;
if(!ex || !ey || !ez) return;
ex->Create(n,n,n); ey->Create(n,n,n); ez->Create(n,n,n);
float x,y,z, r1,r2;
//Chapter 2: MathGL examples 79
for(i=0;i<n;i++) for(j=0;j<n;j++) for(k=0;k<n;k++)
{
x=2*i/(n-1.)-1; y=2*j/(n-1.)-1; z=2*k/(n-1.)-1; i0 = i+n*(j+k*n);
r1 = pow(x*x+y*y+(z-0.3)*(z-0.3)+0.03,1.5);
r2 = pow(x*x+y*y+(z+0.3)*(z+0.3)+0.03,1.5);
ex->a[i0]=0.2*x/r1 - 0.2*x/r2;
ey->a[i0]=0.2*y/r1 - 0.2*y/r2;
ez->a[i0]=0.2*(z-0.3)/r1 - 0.2*(z+0.3)/r2;
}
}
void mgls_prepare3d(mglData *a, mglData *b=0)
{
register long i,j,k,n=61,m=50,l=40,i0;
if(a) a->Create(n,m,l); if(b) b->Create(n,m,l);
float x,y,z;
for(i=0;i<n;i++) for(j=0;j<m;j++) for(k=0;k<l;k++)
{
x=2*i/(n-1.)-1; y=2*j/(m-1.)-1; z=2*k/(l-1.)-1; i0 = i+n*(j+m*k);
if(a) a->a[i0] = -2*(x*x + y*y + z*z*z*z - z*z - 0.1);
if(b) b->a[i0] = 1-2*tanh((x+y)*(x+y));
}
}
int sample2(mglGraph *gr)
{
/*   
gr->Rotate(60,40);
gr->Box();
*/
gr->SubPlot(3,2,0); gr->Title("StickPlot");
gr->StickPlot(3, 0, 20, 30); gr->Box("r"); gr->Puts(mglPoint(0),"0","r");
gr->StickPlot(3, 1, 20, 30); gr->Box("g"); gr->Puts(mglPoint(0),"1","g");
gr->StickPlot(3, 2, 20, 30); gr->Box("b"); gr->Puts(mglPoint(0),"2","b");
gr->SubPlot(3,2,3,""); gr->Title("ColumnPlot");
gr->ColumnPlot(3, 0); gr->Box("r"); gr->Puts(mglPoint(0),"0","r");
gr->ColumnPlot(3, 1); gr->Box("g"); gr->Puts(mglPoint(0),"1","g");
gr->ColumnPlot(3, 2); gr->Box("b"); gr->Puts(mglPoint(0),"2","b");
gr->SubPlot(3,2,4,""); gr->Title("GridPlot");
gr->GridPlot(2, 2, 0); gr->Box("r"); gr->Puts(mglPoint(0),"0","r");
gr->GridPlot(2, 2, 1); gr->Box("g"); gr->Puts(mglPoint(0),"1","g");
gr->GridPlot(2, 2, 2); gr->Box("b"); gr->Puts(mglPoint(0),"2","b");
gr->GridPlot(2, 2, 3); gr->Box("m"); gr->Puts(mglPoint(0),"3","m");
gr->SubPlot(3,2,5,""); gr->Title("InPlot"); gr->Box();
gr->InPlot(0.4, 1, 0.6, 1, true); gr->Box("r");
gr->MultiPlot(3,2,1, 2, 1,""); gr->Title("MultiPlot");
gr->Box();
return 0;

///Chapter 2: MathGL examples 7
}
int sample1(mglGraph *gr)
{
    gr->SubPlot(3,2,0); gr->Title("Usual axis"); gr->Axis();
gr->SubPlot(3,2,1); gr->Title("Too big/small range");
gr->SetRanges(-1000,1000,0,0.001); gr->Axis();
gr->SubPlot(3,2,3); gr->Title("Too narrow range");
gr->SetRanges(100,100.1,10,10.01); gr->Axis();
gr->SubPlot(3,2,4); gr->Title("Disable ticks tuning");
gr->SetTuneTicks(0); gr->Axis();
gr->SubPlot(3,2,2); gr->Title("Manual ticks"); gr->SetRanges(-M_PI,M_PI, 0, 2);
float val[]={-M_PI, -M_PI/2, 0, 0.886, M_PI/2, M_PI};

//gr->SetTicksVal(’x’, mglData(6,val), "-\\pi\n-\\pi/2\n0\nx^*\n\\pi/2\n\\pi");
//gr->Axis(); gr->Grid();
gr->FPlot("2*cos(x^2)^2", "r2");
//gr->SubPlot(3,2,5); gr->Title("Time ticks"); gr->SetRange(’x’,0,3e5);
//gr->SetTicksTime(’x’,0); gr->Axis();
    return 0;
}
int sample33(mglGraph *gr){
  

/*
y1.Modify("0.3*sin(2*pi*x)");
y2.Modify("0.5+0.3*cos(2*pi*x)");
gr->Box();
gr->Region(y1,y2,"r");
gr->Plot(y1,"k2");
gr->Plot(y2,"k2");
 */
return 0;
}
int sample4(mglGraph *gr)
{
gr->SubPlot(2,2,0,"<_"); gr->Title("Semi-log axis");
gr->SetRanges(0.01,100,-1,1); gr->SetFunc("lg(x)","");
gr->Axis(); gr->Grid("xy","g"); gr->FPlot("sin(1/x)");
gr->Label('x',"x",0); gr->Label('y', "y = sin 1/x",0);
gr->SubPlot(2,2,1,"<_"); gr->Title("Log-log axis");
gr->SetRanges(0.01,100,0.1,100); gr->SetFunc("lg(x)","lg(y)");
gr->Axis(); gr->FPlot("sqrt(1+x^2)"); //gr->Label(’x’,"x",0);
gr->Label('y', "y = \\sqrt{1+x^2}",0);
gr->SubPlot(2,2,2,"<_"); gr->Title("Minus-log axis");
gr->SetRanges(-100,-0.01,-100,-0.1); gr->SetFunc("-lg(-x)","-lg(-y)");
gr->Axis(); gr->FPlot("-sqrt(1+x^2)");
gr->Label('x',"x",0); gr->Label('y', "y = -\\sqrt{1+x^2}",0);
gr->SubPlot(2,2,3,"<_"); gr->Title("Log-ticks");
gr->SetRanges(0.1,100,0,100); gr->SetFunc("sqrt(x)","");
gr->Axis(); gr->FPlot("x");
gr->Label('x',"x",1); gr->Label('y', "y = x",0);
return 0;
}
int sample3(mglGraph *gr)
{
gr->SetOrigin(-1,1,-1);
gr->SubPlot(2,2,0); gr->Title("Cartesian"); gr->Rotate(50,60);
gr->FPlot("2*t-1","0.5","0","r2");
gr->Axis(); gr->Grid();
gr->SetFunc("y*sin(pi*x)","y*cos(pi*x)",0);
gr->SubPlot(2,2,1); gr->Title("Cylindrical"); gr->Rotate(50,60);
gr->FPlot("2*t-1","0.5","0","r2");
gr->Axis(); gr->Grid();
gr->SetFunc("2*y*x","y*y - x*x",0);
gr->SubPlot(2,2,2); gr->Title("Parabolic"); gr->Rotate(50,60);
gr->FPlot("2*t-1","0.5","0","r2");
gr->Axis(); gr->Grid();
gr->SetFunc("y*sin(pi*x)","y*cos(pi*x)","x+z");
gr->SubPlot(2,2,3); gr->Title("Spiral"); gr->Rotate(50,60);
gr->FPlot("2*t-1","0.5","0","r2");
gr->Axis(); gr->Grid();
gr->SetFunc(0,0,0); // set to default Cartesian
return 0;
}
int sample5(mglGraph *gr)
{
gr->SubPlot(2,2,0); gr->Title("Colorbar out of box"); gr->Box();
gr->Colorbar("<"); gr->Colorbar(">");
gr->Colorbar("_"); gr->Colorbar("^");
gr->SubPlot(2,2,1); gr->Title("Colorbar near box"); gr->Box();
gr->Colorbar("<I"); gr->Colorbar(">I");
gr->Colorbar("_I"); gr->Colorbar("^I");
gr->SubPlot(2,2,2); gr->Title("manual colors");
mglData a,v;
mgls_prepare2d(&a,0,&v);
//Chapter 2: MathGL examples 23
gr->Box(); gr->ContD(v,a);
gr->Colorbar(v,"<"); gr->Colorbar(v,">");
gr->Colorbar(v,"_"); gr->Colorbar(v,"^");
gr->SubPlot(2,2,3); gr->Title("log-scale");
gr->SetRange('c',0.01,1e3);
gr->Colorbar(">",0.5,0); gr->Puts(mglPoint(0,1.2),"Normal scale");
gr->SetFunc("","","","lg(c)");
gr->Colorbar(">"); gr->Puts(mglPoint(1.3,1.2),"Log scale");

return 0;
}
int sample7(mglGraph *gr)
{
mglData a,b,d; mgls_prepare2v(&a,&b); d = a;
for(int i=0;i<a.nx*a.ny;i++) d.a[i] = hypot(a.a[i],b.a[i]);
mglData c; mgls_prepare3d(&c);
mglData v(10); v.Fill(-0.5,1);
gr->SubPlot(2,2,1,""); gr->Title("Flow + Dens");
gr->Flow(a,b,"br"); gr->Dens(d,"BbcyrR"); gr->Box();
gr->SubPlot(2,2,0); gr->Title("Surf + Cont"); gr->Rotate(50,60);
//Chapter 2: MathGL examples 85
gr->Light(true); gr->Surf(a); gr->Cont(a,"y"); gr->Box();
gr->SubPlot(2,2,2); gr->Title("Mesh + Cont"); gr->Rotate(50,60);
gr->Box(); gr->Mesh(a); gr->Cont(a,"_");
gr->SubPlot(2,2,3); gr->Title("Surf3 + ContF3");gr->Rotate(50,60);
gr->Box(); gr->ContF3(v,c,"z",0); gr->ContF3(v,c,"x"); gr->ContF3(v,c);
gr->SetCutBox(mglPoint(0,-1,-1), mglPoint(1,0,1.1));
gr->ContF3(v,c,"z",c.nz-1); gr->Surf3(-0.5,c);
return 0;
}
int sample8(mglGraph *gr)
{
mglData a,b; mgls_prepare2v(&a,&b);
gr->SubPlot(2,2,0,""); gr->Title("Flow plot (default)");
gr->Box(); gr->Flow(a,b);
gr->SubPlot(2,2,1,""); gr->Title("’v’ style");
gr->Box(); gr->Flow(a,b,"v");
gr->SubPlot(2,2,2,""); gr->Title("’\\#’ style");
gr->Box(); gr->Flow(a,b,"#");
mglData ex,ey,ez;
mgls_prepare3v(&ex,&ey,&ez);
//Chapter 2: MathGL examples 82
gr->SubPlot(2,2,3); gr->Title("3d variant"); gr->Rotate(50,60);
gr->Box(); gr->Flow(ex,ey,ez);
return 0;
}

int sample10(mglGraph *gr)
{

gr->Title("Surf3 plot"); gr->Rotate(50,60);
gr->Light(true); gr->Alpha(true);
//gr->Box(); gr->Surf3(c);
return 0;
}
int sample11(mglGraph *gr)
{
 
gr->AddLegend("sin(\\pi {x^2})","b");
gr->AddLegend("sin(\\pi x)","g*");
gr->AddLegend("sin(\\pi \\sqrt{x})","rd");
gr->AddLegend("just text"," ");
gr->AddLegend("no indent for this","");
gr->SubPlot(2,2,0,""); gr->Title("Legend (default)");
gr->Box(); gr->Legend();
gr->Legend(3,"A#");
gr->Puts(mglPoint(0.75,0.65),"Absolute position","A");
//Chapter 2: MathGL examples 28
gr->SubPlot(2,2,2,""); gr->Title("coloring"); gr->Box();
gr->Legend(0,"r#"); gr->Legend(1,"Wb#"); gr->Legend(2,"ygr#");
gr->SubPlot(2,2,3,""); gr->Title("manual position");

//------------------

gr->Title("Surf3 plot"); gr->Rotate(50,60);
gr->Light(true); gr->Alpha(true);

gr->Box(); gr->Legend(0.5,0.5);
return 0;
}

//-----------------------------------------------------
int main(int argc,char **argv)

 
    //mglData yx;

   
 


   

mglWindow gr(sample11,"MathGL examples");

gr.FPlot("sin(pi*10*x)");
gr.WriteFrame("test.png");
return gr.Run();
} and everything was working well before so I dont understant

thank you fpr helping

                 from /usr/include/mgl2/window.h:24,
                 from main.cpp:1:
/usr/local/include/FL/Fl_Menu_Item.H: In member function ‘long int Fl_Menu_Item::argument() const’:
/usr/local/include/FL/Fl_Menu_Item.H:259:40: error: ‘fl_intptr_t’ was not declared in this scope
   long argument() const {return (long)(fl_intptr_t)user_data_;}
                                        ^
/usr/local/include/FL/Fl_Menu_Item.H:259:52: error: expected ‘;’ before ‘user_data_’
   long argument() const {return (long)(fl_intptr_t)user_data_;}
                                                    ^
make: *** [build/Debug/GNU-Linux-x86/main.o] Error 1
nbproject/Makefile-Debug.mk:66: recipe for target 'build/Debug/GNU-Linux-x86/main.o' failed

COMPILE FILE FAILED (exit value 2, total time: 2s)

mathgl....@gmail.com

unread,
Dec 18, 2014, 3:47:36 PM12/18/14
to mat...@googlegroups.com
Dear Frederic,

It look as you are using wrong installation (or conflict of versions) of FLTK.

--
You received this message because you are subscribed to the Google Groups "MathGL" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mathgl+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages