I after vast effort could (details are in here FLTK version 1.3.2, Visual studio 2012 and the first example of Stroustrup's PPP book) to ran the below code;
#include <Simple_window.h>
#include <Graph.h>
//*********************************************
int main()
{
using namespace Graph_lib;
Point tl(100,100);
Simple_window win(tl,600,400,"Canvas");
Graph_lib::Polygon poly;
poly.add(Point(300,200));
poly.add(Point(350,100));
poly.add(Point(400,200));
win.attach(poly);
win.set_label("Canvas");
win.wait_for_button();
}
But for Polygon poly;
I should use Graph_lib::
, while since I have added the statement using namespace Graph_lib;
at the top of the code's body (just below the main
function) so there should not be any need to use the Graph_lib::
for Polygon. But in effect without using it I get ambiguous symbol error. and also even I remove that statement (using namespace Graph_lib;
) I don't get any error. My question is that why that statement doesn't work for that code and I have to use Graph_lib::
?