gvRenderFilename in Visual Studio qt project

Hello. I have problem with gvRenderFilename function. If i create consol application in Visual studio, it`s work and save the file. If i create the qt project (with the same code), gvRenderFilename return -1 and dont save file.Why?
#include "graph_qt.h"

#include "gvc.h"
#include "cgraph.h"

int main(int argc, char *argv[])
Agraph_t *G;
GVC_t* gvc;
Agnode_t *n, *m, *c;
Agedge_t *e, *e1;
FILE *f;

QApplication a(argc, argv);

f = fopen("C:/tes1.png", "wb+");

G = agopen("132",Agdirected,0);
gvc = gvContext(); /* library function */
n = agnode(G, "n", 1);
m = agnode(G, "m", 1);
c = agnode(G, "c", 1);
e = agedge(G, n, m, 0, 1);
e1 = agedge(G, n, n, 0, 1);
agedge(G, c, n, 0, 1);
agedge(G, c, m, 0, 1);
gvLayout (gvc, G, "dot"); /* library function */
int result = gvRenderFilename(gvc,G,"canon","C:/tes1.dot");
gvFreeLayout(gvc, G); /* library function */
agclose (G); /* library function */

graph_qt w;
return a.exec();

What is graph_qt.h ? If

What is graph_qt.h ?

If gvRenderFiles returns -1, it should also print an error message on the console. Is there a way to capture console output using Qt? If not, you can arrange to have the error messages directed to a function you supply using agseterrf() in cgraph.h.

Recent comments