Graphviz - Failed to load gvplugin_pango.dll

I am trying to run graphviz as a library from CLion on Windows. It took me quite a while to get this far, and I hope this is the last hurdle. When I run the program, I see the following warning and graph

Warning: Could not load "C:\Program Files (x86)\Graphviz2.38\bin\gvplugin_pango.dll" - can't open the module 

I am running CLion with MinGW 3.22 as a toolchain. CmakeLists and main.c are given below. Unfortunately, I can not register for graphviz forums, so I hope someone here can have suggestions. While I tried -

  • Install and use mingw-64
  • Installing the old version of GraphViz (2.28, current 2.38)
  • Including gvplugin_pango library in cmakelists.txt
  • Changing permissions for the Graphviz folder to provide full access to all, proven dot -c and works fine
  • Set the env variable GVBINDIR to explicitly indicate installation 2.38.
  • Tried setting up m32 in Cmakelists.txt (not 100% I did it right)

CMakeLists.txt

 cmake_minimum_required(VERSION 3.6) project(Learning) set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS}") set(GRAPHVIZ_INCLUDE_DIR "C:/Program Files (x86)/Graphviz2.38/include/graphviz") set(GRAPHVIZ_LIB_DIR "C:/Program Files (x86)/Graphviz2.38/lib/release/lib") set(SOURCE_FILES main.c) include_directories("${GRAPHVIZ_INCLUDE_DIR}") add_executable(Learning ${SOURCE_FILES}) find_library(CGRAPH_LIBRARY cgraph HINTS "${GRAPHVIZ_LIB_DIR}" REQUIRED) find_library(GVC_LIBRARY gvc HINTS "${GRAPHVIZ_LIB_DIR}" REQUIRED) target_link_libraries( Learning ${CGRAPH_LIBRARY} ${GVC_LIBRARY} ) 

main.c

 #include <stdio.h> #include <malloc.h> #include <string.h> #include <gvc.h> #include <cgraph.h> int main() { Agraph_t *graph; Agnode_t *nodeA, *nodeB; Agedge_t *edge1; Agsym_t *symbol1; GVC_t *gvc; gvc = gvContext(); graph = agopen( "graph", Agdirected, NULL); nodeA = agnode(graph, "nodeA", 1); nodeB = agnode(graph, "nodeB", 1); edge1 = agedge(graph, nodeA, nodeB, 0, 1); printf("debug"); agsafeset(nodeA, "color", "red", ""); gvLayout(gvc, graph, "dot"); gvRender(gvc, graph, "dot", NULL); agclose(graph); return ( gvFreeContext(gvc)); } 
+7
graphviz mingw clion pango
source share
2 answers

A warning may be caused by the absence of runtime pango library. You can try installing the appropriate pango or pangocairo for your mingw setup to see if this fixes the problem.

Let me know if this works!

0
source share

I am not familiar with mingw32 or a big fan of this, but it looks like you need to determine that gvplugin_pango.dll and its dependencies are loading.

On Unix, you would use a utility for this, but there is no "ldd" or "otool" to help with this in mingw (really?)

The following stackoverflow article offers literally grepping libraries for finding DLLs needed for Win exe on Linux (compiled using mingw)?

This article points to this utility since 2015: https://github.com/gsauthof/pe-util and there is something strange called "Dependency Walker" http://www.dependencywalker.com

Excuse for troubling.

-one
source share

All Articles