hi i downloaded a source-code from the net for testing. the source code folder contains around 40 files(.cpp + .h ) along with a readme.txt.
for compilation they have given told to type "make".
after typing "make" ....i got the following....
$ make
g++ -c -O2 -Wall bat_graph.cpp
bat_graph.cpp: In method `int bat_graph::get_params ()':
bat_graph.cpp:147: `sscanf' undeclared (first use this function)
bat_graph.cpp:147: (Each undeclared identifier is reported only once
for each function it appears in.)
make: *** [bat_graph.o] Error 1
what could be the possible error ? what does the compiler pointing ?
you know, i went to line 147 of the code bat_graph.cpp (according to compiler's notification) , but i found nothing is wrong there.
well, what i have found there i am writng below......
( code is big...so i am excerpting imporatant points)
snippet from the code bat_graph.cpp ......
Code:
// blah.....
char c;
134 char *pp = Preamble;
135 int stop = 0;
136 char *tmp = new char[100];
137
138 Nr_vert = Nr_edges = 0;
139
140 while (!stop && (c = *pp++) != '\0'){
141 switch (c) {
142 case 'c':
143 while ((c = *pp++) != '\n' && c != '\0');
144 break;
145
146 case 'p':
147 sscanf(pp, "%s %d %d\n", tmp, &Nr_vert, &Nr_edges);
148 stop = 1;
149 break;
150
// blah.....
do you think is there anything wrong at line 147 ? i dont see any error....
anyway, can you suggest what could be the problem by watching compiler's notification.
the whole code is big enough so, i have given a snippet of the troublesome area notified by the compiler.
any suggestion to remove error ?
thanks