网站: Code-by.Org
2017-06-29
相关链接安装
- GraphViz-2.24.tgz 解压,进入目录:
>perl Makefile.PL
Please install Graphviz from http://www.graphviz.org/
从官网下载 graphviz-2.38.zip ,
将其中的目录释放/合并到 Strawberry Perl安装目录的c目录下(eg. C:\Strawberry\c)
重新尝试:
> perl Makefile.PL
Checking if your kit is complete...
Looks good
Warning: prerequisite XML::XPath 1.13 not found.
Generating a dmake-style Makefile
Writing Makefile for GraphViz
Writing MYMETA.yml and MYMETA.json
> dmake
> dmake install
无误后运行示例代码(稍作修改)
use GraphViz; my $g = GraphViz->new(); $g->add_node('London'); $g->add_node('Paris', label => 'City of\nlurve'); $g->add_node('New York'); $g->add_edge('London' => 'Paris'); $g->add_edge('London' => 'New York', label => 'Far'); $g->add_edge('Paris' => 'London'); $g->as_png("simple.png");