Number: 2035
Title: agread crash
Submitter: Piotr N
Date: Wed Sep 15 06:48:49 2010
Subsys: Lib(c)graph
Version: 2.26.3
System: x86-Windows-xp sp3
Severity: critical
Problem:
Hi, I'm trying to use graphviz as a library in na qt/c++ app, program crashes everytime I call agread function with a parameter - file pointer to file containing definition of a graph in DOT langauge

I/ve also tried in plain C - and the error is still there

Here's my code:


#include <stdio.h>
#include <stdlib.h>
#include <gvc.h>

int main(int argc, char** argv) { FILE *fp; GVC_t * gvc; Agraph_t * g; char line[80];

gvc = gvContext(); printf("1n"); fp = fopen("tmpgraph.gv", "r"); //w+ printf("File openedncontent:n"); while(fgets(line, 80, fp) != NULL) { printf(line); }

printf("n 2n"); g = agread(fp); printf("3"); return (EXIT_SUCCESS); }

3 is never printed.
Input:

digraph G {
START -> mag139[label="0000000767nPW/41/10 Lp. 1"];
mag139 -> mag12[label="0000000767nWZ/8/10 Lp. 1"];
mag139 [shape=circle,label="Mag 1"];
mag12 [shape=triangle,peripheries=2,label="Mag 2"];
}
Comments:
[arif] I assume you linked your program against the libraries that we provide in graphviz package. Can you tell me if you use the debug or release libraries?
Owner: *
Status: *