Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/130.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 用于C+的Mathgl绘图库安装+;_C++_Windows 7_Plot_Mathgl - Fatal编程技术网

C++ 用于C+的Mathgl绘图库安装+;

C++ 用于C+的Mathgl绘图库安装+;,c++,windows-7,plot,mathgl,C++,Windows 7,Plot,Mathgl,我已使用sourceforge中的windows二进制文件在win7计算机中安装了MathGL库。我已按照说明进行操作,并已包含mathgl bin;将和lib文件包含到相应的mingw文件夹中。 但当我尝试运行以下测试示例时: #include <mgl2/mgl.h> int main() { mglGraph gr; gr.FPlot("sin(pi*x)"); gr.WriteFrame("test.png"); } 头文件丢失: from

我已使用sourceforge中的windows二进制文件在win7计算机中安装了MathGL库。我已按照说明进行操作,并已包含mathgl bin;将和lib文件包含到相应的mingw文件夹中。 但当我尝试运行以下测试示例时:

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

           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
#include <gif_lib.h>
#包括
我注意到预编译的windows文件夹没有特定的标题“gif_lib.h”

我的问题如下:

在安装过程中我是否遗漏了什么?? 如果我不知道在哪里可以找到那个特定的标题(我在谷歌上搜索过,什么都没有:()

我已按照以下说明安装了库:

           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
#include <gif_lib.h>
“1.3安装

MathGL可以用4种不同的方式安装

从源代码处编译。库中使用cmake构建系统。要运行它,应执行以下命令:cmake。两次,在使用root/sudo权限进行make和make install之后。有时在安装之后,您可能需要更新库列表–只需使用root/sudo权限执行ldconfig。 默认情况下,有几个附加选项处于关闭状态。它们是:启用fltk、启用glut、启用qt以显示fltk、glut和/或qt窗口;启用jpeg、启用gif、启用hdf5等以启用相应的文件格式;启用all以启用所有附加功能。对于使用double作为基本内部数据类型,请使用option enable double。要启用语言接口,请使用enable python、enable octave或enable all swig For all language。您可以使用WYSIWYG工具(cmake gui)查看所有语言界面,或在命令行中键入cmake-D enable all=on-D enable all widgets=on-D enable all swig=on。以启用所有功能

使用预编译的二进制文件。MinGW(平台Win32)有一些二进制文件。对于预编译的变体,只需将归档文件解压缩到编译器的位置(即MinGW/lib中的mathgl/lib、MinGW/include中的mathgl/include等)或者在编译器中的任意其他文件夹和安装路径中。默认情况下,预编译版本包括GSL(www.GSL.org)和PNG的支持。因此,需要在系统上安装这些库(例如,可以在中找到)。 从标准软件包(RPM、deb、DevPak等)安装预编译版本。 注意,您可以通过以下命令从sourceforge.net SVN下载最新的源代码(可能不稳定)


svn checkout mathgl code”“

对于较旧的mathgl版本,假设您已经安装了所有附加库(即giflib——缺少头文件)


对于较新的MathGL版本,所有这些外部依赖项都是“隐藏”的,不是必需的。

您的错误消息(来自您粘贴的日志)似乎您丢失了;在canvas.hHi的第409行附近,canavas.h根据安装说明,它包含在include>mgl2下的目录中。可能您可以查看此文件来修复此错误--“error:expected';'before'*'token”。我在这方面不是专家,但在阅读错误消息后,我是这么想的。