Issue with Graphviz - gvLayout() - Working with library

964 Views Asked by At

I`m coding in C#. I'm sending the arguments below to the function gvLayout(gvc, g, layout)

IntPtr gvc = gvContext();

// My string containing the graph
IntPtr g = agmemread(source);

string layout = "nop";

I have imported the dlls from graphviz's folder.

I get the answer:

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

So I tried:

string layout = "dot";

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

The int return value of gvLayout(gvc, g, layout) I get is -1 (should be 0).


UPDATE:

I put all dlls and config6 file into my project. Now I get the message 4 times and then nothing happens:

"The program can't start because libglib-2.0-0.dll is missing from your computer. Try reinstalling the program to fix this problem."

The thing is that the file is already there. I tried also adding a copy of that file to the folder System32 but it didn't work either.


I've already read Why does Graphviz fail on gvLayout? and couldn't reach a solution.

3

There are 3 best solutions below

1
Emden On

How did you install graphviz? Are you linking against the installed version, or did you copy the dlls elsewhere? The plugin mechanism relies on a file called config6 being with the dll's in order to determine what plugins are available.

0
user3455180 On

Are you sure that all of your DLL files are in the right folder? I get rid of the error when I actually copied all the files in the graphviz directory to the right debug folder....

0
AdriZ On

Having the same problem, I solved it copying all the *.dll and the "config6" file from "C:\Program Files (x86)\Graphviz\bin" next to my executable.


I first tried to copy just needed .dll but I'd got some errors or problems with fonts or layout. I ended by copying all .dll and now all works fine.