本文介绍了无法使用点布局(graphviz作为库)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将graphviz(v2.28.0)用作C ++应用程序中的库,我想使用点布局来绘制图形.一切正常,直到我调用 gvLayout(_context,_graph,"dot"); 函数,该函数会输出以下错误:

I use graphviz (v2.28.0) as a library in a C++ application and I would like to render graphs using the dot layout. Everything works fine until I call the gvLayout(_context, _graph, "dot"); function which outputs the following error :

 Error: Layout type: "dot" not recognized. Use one of:

我在链接时使用以下库标志:

I use the following library flags when linking :

-lgvc -lgraph -lpathplan -lcdt -lgvplugin_dot_layout

从Unix命令行调用点可以正常工作.我在做什么错了?

Calling dot from the Unix command line works as expected. What am I doing wrong ?

推荐答案

您可能已经解决了这个问题或放弃了,但是我到这里结束了,所以我敢肯定其他人会...

You probably either already fixed this or gave up, but I ended up here so I'm sure someone else will...

插件需要显式加载.我不确定这是否与静态链接有关,还是在将graphviz用作库时需要完成此操作.

Plugins need to be loaded explicitly. I'm not sure whether this is related to static linking or needs to be done whenever graphviz is used as a library.

对我来说,这个固定点是

This fixed dot for me:

extern gvplugin_library_t gvplugin_dot_layout_LTX_library;
gvAddLibrary(gvc, &gvplugin_dot_layout_LTX_library);

这篇关于无法使用点布局(graphviz作为库)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-19 02:52