Menu

#31 some problems

v1.0_(example)
open
1
2015-04-10
2015-04-10
Yaoting
No

I Use the ver 2.3.2 with the visual studio 2013.

A:the first problem

I found the mgl-glut can't work
if i change the code in the glut.cpp
//origin-----------------------------------------------------------------------------
HMGL MGL_EXPORT mgl_create_graph_glut(int (draw)(HMGL gr, void p), const char title, void par, void (load)(void p))
{
mglCanvasGLUT *g = new mglCanvasGLUT;
g->Window(0,0,draw,title,par, load);
return g;
}

to
//new-----------------------------------------------------------------------------
HMGL MGL_EXPORT mgl_create_graph_glut(int (draw)(HMGL gr, void p), const char title, void par, void (load)(void p))
{
mglCanvasGLUT *g = new mglCanvasGLUT;
//g->Window(0,0,draw,title,par, load);
g->Window(1, 0, draw, title, par, load);
return g;
}
it will does work.

B: the second problem:
I use the gsl v1.16 library, but I found it will have these link error
1>MSVCRT.lib(MSVCR120.dll) : error LNK2005: _acosh 已经在 eval.obj 中定义
1>MSVCRT.lib(MSVCR120.dll) : error LNK2005: _atanh 已经在 eval.obj 中定义

If I change the code in the eval.cpp, line 497

// origin

ifdef WIN32

double MGL_LOCAL_CONST asinh(double x) { return log(x+sqrt(xx+1.)); }
double MGL_LOCAL_CONST acosh(double x) { return x>1 ? log(x+sqrt(x
x-1.)) : NAN; }
double MGL_LOCAL_CONST atanh(double x) { return fabs(x)<1 ? log((1.+x)/(1.-x))/2 : NAN; }

endif

to
// new
//#ifdef WIN32

ifndef WIN32

double MGL_LOCAL_CONST asinh(double x) { return log(x+sqrt(xx+1.)); }
double MGL_LOCAL_CONST acosh(double x) { return x>1 ? log(x+sqrt(x
x-1.)) : NAN; }
double MGL_LOCAL_CONST atanh(double x) { return fabs(x)<1 ? log((1.+x)/(1.-x))/2 : NAN; }

endif

it will successfully generate.

Discussion

Anonymous
Anonymous

Add attachments
Cancel