title: Graphviz as Library error: too many arguments to function ‘agnode’
body: <p>I'm trying to run a example from the "Using Graphviz as a library" in <a href="http://www.graphviz.org/Documentation.php" rel="nofollow">http://www.graphviz.org/Documentation.php</a>.</p>
  
  <pre><code>#include &lt;gvc.h&gt;
  int main(int argc, char **argv)
  {
      Agraph_t *g;
      Agnode_t *n, *m;
      Agedge_t *e;
      Agsym_t *a;
      GVC_t *gvc;
      /* set up a graphviz context */
      gvc = gvContext();
      /* parse command line args - minimally argv[0] sets layout engine */
      gvParseArgs(gvc, argc, argv);
      /* Create a simple digraph */
      g = agopen("g", Agdirected);
      n = agnode(g, "n", 1);
      m = agnode(g, "m", 1);
      e = agedge(g, n, m, 0, 1);
      /* Set an attribute - in this case one that affects the visible rendering */
      agsafeset(n, "color", "red", "");
      /* Compute a layout using layout engine from command line args */
      gvLayoutJobs(gvc, g);
      /* Write the graph according to -T and -o options */
      gvRenderJobs(gvc, g);
      /* Free layout data */
      gvFreeLayout(gvc, g);
      /* Free graph structures */
      agclose(g);
      /* close output file, free context, and return number of errors */
      return (gvFreeContext(gvc));
  }
  </code></pre>
  
  <p>I'm compiling and linking with : gcc -Wall <code>pkg-config libgvc --cflags --libs</code> *.c -o EXE -lgvc </p>
  
  <p>and then I see this result:</p>
  
  <pre><code>graph.c: In function ‘main’:
  graph.c:14:18: error: ‘Agdirected’ undeclared (first use in this function)
  graph.c:14:18: note: each undeclared identifier is reported only once for each function it appears in
  graph.c:15:2: error: too many arguments to function ‘agnode’
  In file included from /usr/include/graphviz/types.h:717:0,
                   from /usr/include/graphviz/gvc.h:20,
                   from graph.c:1:
  /usr/include/graphviz/graph.h:185:22: note: declared here
  graph.c:16:2: error: too many arguments to function ‘agnode’
  In file included from /usr/include/graphviz/types.h:717:0,
                   from /usr/include/graphviz/gvc.h:20,
                   from graph.c:1:
  /usr/include/graphviz/graph.h:185:22: note: declared here
  graph.c:17:2: error: too many arguments to function ‘agedge’
  In file included from /usr/include/graphviz/types.h:717:0,
                   from /usr/include/graphviz/gvc.h:20,
                   from graph.c:1:
  /usr/include/graphviz/graph.h:192:22: note: declared here
  graph.c:7:11: warning: unused variable ‘a’ [-Wunused-variable]
  graph.c:6:12: warning: variable ‘e’ set but not used [-Wunused-but-set-variable]
  </code></pre>
  
  <p>Could anyone help me understand what is going on? Why the compiler is complaining about those arguments in those functions?</p>
  
  <p>Thank you!!!!</p>