Unable to use dot layout (graphviz as a library)

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
Calling dot from the Unix command line works as expected. What am I doing wrong ?

 

Unable to use dot layout

You need to initialize for demand loading, using:
    GVC_t *gvContextPlugins(const lt_symlist_t *builtins, int demand_loading);
 
You might take a look at the code in:  tclpkg/gv/gv.cpp
This is a C++ wrapper for libgvc etc   that is used for all the swig-based language binfings.
 

Recent comments