Graphviz as a library, error layout type

I've encountered a problem with including graphviz as a library in c++ project. I've included the libraries from installed
graphviz, those from lib and include folder in my project properties. I've also included gvc.h file in my c++ project, then I've copied the example source code you've provided. The build stage passed successfully but when I try to execute the program, it throws a memory error:

Unhandled exception at 0x1000267d in przykladGraph.exe: 0xC0000005: Access violation reading location 0x00000000.

I'm using Visual Studio 2010.
Please, Help me :)

edit: I've this problem when I include cgraph.lib. I understand that I must only include the library:
gvc, graph, pathplan, cdt

I did it and I have new problem:

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

I found that I need to use gvContextPlugins. I used the example:
but it does not work
error LNK2001: unresolved external symbol "struct gvplugin_library_t gvplugin_dot_layout_LTX_library" ([email protected]@[email protected]@A)

How should I use gvContextPlugins?

Graphviz as a library, error

I believe you are making things too complex, but without more information, it is difficult to say where the problem is arising. Consider filing a bug report at

so we can see what you are trying to do.

Graphviz as a library, error

Ok, I start again from beginning.
I need to instruction step by step, how to include graphviz as a library in Visual Studio C++.
What I have done:
1. In the project's properties I have added Incude and Library Directoriy
2. I have included:













And I have error:

ErrorLayout type: "dot" not recognized

What else should I do?





Graphviz as a library, error

Without more details about your program and how you are building it, I can only guess, but normally, you don't need any of the gvplugin_ files; these are loaded dynamically. When you call gvLayout(), it looks for a file called config6 in the same directory containing gvc.dll. The config6 file tells Graphviz which layouts and output formats are available on the system. The message Layout type: "dot" not recognized indicates that either Graphviz didn't find config6 or it doesn't contain the dot layout. There is normally more to the error message that would indicate which, but it is probably the former.
If you link the gvc library into your program statically, then I would guess that Graphviz will be looking for config6 in the same directory containing your program, so you would need to install it there. Alternatively, you can set an environment variable called GVBINDIR which can provide the path to the directory containing the config6 file.
If you are going the route of static linking, you may want to go all the way and build your program so that Graphviz does no dynamic lookup at all but just uses the components you've built into it.

Graphviz as a library, error

Thank you for your help. This file is what I needed. But I have one more question. Is it possible to save the render method output (plain) to variable?

Graphviz as a library, error

If you mean, can you use an attribute to specify the output format, no. That has to specified as an argument to gvRender(). (Note that you can use the layout attribute to tell Graphviz which layout to use.)
If you are asking something else, let me know.

Recent comments